RFR: 8339148: Add os::active_physical_processor_count() API
Severin Gehwolf
sgehwolf at openjdk.org
Fri Aug 30 08:48:20 UTC 2024
On Fri, 30 Aug 2024 08:16:37 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
>> src/hotspot/os/linux/os_linux.cpp line 4833:
>>
>>> 4831:
>>> 4832: // Return the active CPUs irrespective of the system being containerized
>>> 4833: // or not. Thus, this returns the host active cpus in a container.
>>
>> No it doesn't! The comment for the function you call states clearly:
>>
>> // Get the current number of available processors for this process.
>>
>> This is not related to "physical count" at all!
>
> OK. Happy to change the name to something more suitable. The idea is to have a function that returns the "available" cpus of the node/host whether in container or not. How about `available_host_processor_count()`?
Just to be clear. It's not a goal to introduce new semantics. What we need is an public accessible way to query this information.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20768#discussion_r1738228614
More information about the hotspot-runtime-dev
mailing list