RFR: 6942632: Hotspot should be able to use more than 64 logical processors on Windows [v3]

David Holmes dholmes at openjdk.org
Fri Mar 1 05:44:52 UTC 2024


On Wed, 28 Feb 2024 20:46:40 GMT, Saint Wesonga <duke at openjdk.org> wrote:

>> src/hotspot/os/windows/os_windows.cpp line 897:
>> 
>>> 895:   DWORD_PTR lpProcessAffinityMask = 0;
>>> 896:   DWORD_PTR lpSystemAffinityMask = 0;
>>> 897:   if (GetProcessAffinityMask(GetCurrentProcess(), &lpProcessAffinityMask, &lpSystemAffinityMask)) {
>> 
>> I'm struggling to see how we can expose more than 64 processors when our bit-vector is only 64 bits. ??
>
>> I'm struggling to see how we can expose more than 64 processors when our bit-vector is only 64 bits. ??
> 
> This code block does not expose over 64 processors. It only ensures that a request for less than 64 processors is respected when the user launches the process using the start command (which accepts a 64-bit mask) https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/start
> 
> More than 64 cores are exposed by the `logical_processors = processor_count();` assignment a few lines later.

Sorry I'm still not clear here. From my reading `GetProcessAffinityMask` is either going to return a zero mask or a non-zero mask. In the non-zero case, the count must be <=64. So even if we intend to use > 64 processors, this mask reading will always limit us to a value < 64. And the zero mask is only for one special case. So regardless of the use of the "start" command, it seems to me this will cause us to bail out at line 903. ??

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/17576#discussion_r1508502975


More information about the hotspot-runtime-dev mailing list