RFR: 8232651: Add implementation of os::processor_id() for Windows
Bob Vandette
bob.vandette at oracle.com
Mon Oct 21 20:21:41 UTC 2019
> On Oct 21, 2019, at 4:14 PM, Stefan Karlsson <stefan.karlsson at oracle.com> wrote:
>
> Hi Bob,
>
> On 2019-10-21 16:41, Bob Vandette wrote:
>> Have you considered using GetCurrentProcessorNumberEx so you can handle a system with more than 64 CPUs?
>
> If I understand the Windows documentation I linked to below, you need to opt-in to multi-groups to be able to take advantage of more than 64 logical processors. I couldn't find any code that explicitly scheduled threads to other groups than the one the JVM starts in. Neither os::processor_count() nor os::active_processor_count() includes the number of CPUs outside of the current group. If those observations are correct, I don't think it would be appropriate to use GetCurrentProcessorNumberEx without also updating the other Windows code.
>
> Do you agree with this assessment?
I though it might be better to just call the extended API in order to at least prepare any new OS:: interfaces for the
future but it does appear that such support is more involved so I’m good with your assessment.
Bob.
>
> Thanks,
> StefanK
>
>>
>> Bob.
>>
>>
>>> On Oct 21, 2019, at 10:23 AM, Stefan Karlsson <stefan.karlsson at oracle.com> wrote:
>>>
>>> Hi all,
>>>
>>> Please review this patch to add an implementation of os::processor_id() for Windows.
>>>
>>> https://cr.openjdk.java.net/~stefank/8232651/webrev.01/
>>> https://bugs.openjdk.java.net/browse/JDK-8232651
>>>
>>> We need an implementation of this function on Windows, to be able to run ZGC there.
>>>
>>> Note that GetCurrentProcessorNumber only "returns the processor number within the processor group to which the logical processor is assigned". AFAICT, there's no support for multi-groups in HotSpot, and therefore this seems like an adequate function to use.
>>>
>>> See this page for more information about processor groups:
>>> https://docs.microsoft.com/en-us/windows/win32/procthread/processor-groups
>>>
>>> Thanks,
>>> StefanK
>
More information about the hotspot-runtime-dev
mailing list