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

[Linux] Move machine-specific queries to the OSContainer layer

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • hotspot
    • generic
    • linux

      JDK-8292984 started this clean-up, but there are still cases where cgroupSubsystem-related classes call host/machine specific functions. One example is os::Linux::active_processor_count().

      In src/hotspot/os/linux/cgroupSubsystem_linux.cpp I see this code in CgroupSubsystem::active_processor_count:

        cpu_count = os::Linux::active_processor_count();
        result = CgroupUtil::processor_count(contrl->controller(), cpu_count);

      The same is true in CgroupUtil::adjust_controller for os::Linux::physical_memory():

        julong phys_mem = static_cast<julong>(os::Linux::physical_memory());
        char* limit_cg_path = nullptr;
        jlong limit = mem->read_memory_limit_in_bytes(phys_mem);

      We should clean this up.

            Unassigned Unassigned
            sgehwolf Severin Gehwolf
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: