RFR: JDK-8301661: Enhance os::pd_print_cpu_info on macOS and Windows
David Holmes
dholmes at openjdk.org
Sat Feb 4 05:05:54 UTC 2023
On Sat, 4 Feb 2023 04:50:22 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Enhance os::pd_print_cpu_info on macOS and Windows by information about CPU frequency and caches.
>> On Windows , this info can be obtained by the Processor Power Information API or "powerbase" (CallNtPowerInformation , see https://learn.microsoft.com/en-us/windows/win32/api/powerbase/nf-powerbase-callntpowerinformation ); this is available since Windows Server 2003/XP.
>> On macOS, sysctlbyname can be used.
>
> src/hotspot/os/windows/os_windows.cpp line 1898:
>
>> 1896:
>> 1897: PROCESSOR_POWER_INFORMATION ppi;
>> 1898: size_t sz_check = sizeof(ppi) * (size_t)si.dwNumberOfProcessors;
>
> We already have `dwNumberOfProcessors` available in `processor_count()` - though we may have to zero-initialize it and check for zero in case we crash before we've done os::init
That said from what I'm reading if systems have more than 64 processors they will be divided into processor groups and the max number will be 64. However IIUC `CallNtPowerInformation` will expect a buffer big enough for the true number of logical processors >64.
-------------
PR: https://git.openjdk.org/jdk/pull/12403
More information about the hotspot-runtime-dev
mailing list