Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8149185

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P5 P5
    • 10
    • 9
    • 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();

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

              Created:
              Updated:
              Resolved: