os::is_server_class_machine() uses VM_Version::logical_processors_per_package() before the value for threads for core is actually discovered

XMLWordPrintable

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: P5
    • 10
    • Affects Version/s: 9
    • Component/s: hotspot
    • None

      os::is_server_class_machine() uses VM_Version::logical_processors_per_package() before the value for threads for core is actually discovered.
      So when gc is selected VM_Version::logical_processors_per_package() always returns 1.
      This could cause wrong gc to be selected by ergonomics.

      Code from thread.cpp:
      jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
      ....
        os::init_before_ergo();
        jint ergo_result = Arguments::apply_ergo(); //<- os::is_server_class_machine() is called here during select_gc_ergonomically()

      ....
      jint status = init_globals(); //<- thread for core is actually discovered here.

      As far as I understand discovery of cpu threads for core value should be moved to os::init_before_ergo();

            Assignee:
            Unassigned
            Reporter:
            Kirill Zhaldybin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: