Fix NUMA node for heap when NUMA is not available
authorJan Vorlicek <janvorli@microsoft.com>
Thu, 25 Apr 2019 09:32:31 +0000 (11:32 +0200)
committerJan Vorlicek <janvorli@microsoft.com>
Thu, 25 Apr 2019 09:59:06 +0000 (11:59 +0200)
commit8d93bd9080f47efd87dc5420a6e600f8dc432659
tree7fadf71d0c3da50e49e607ac3e2e9594d8cf1fb6
parent8c979b75e59815bcc1c7a9a1acdfda4e143f1a66
Fix NUMA node for heap when NUMA is not available

The recent refactoring of the GCToOSInterface::GetProcessorForHeap has
accidentally changed the NUMA node returned in case NUMA is disabled
(either via the COMPlus_GCNumaAware or due to the fact that there is
just a single NUMA node on the system) and the CPU groups are disabled.
Before that refactoring, the code was incorrectly returning 0 as the
NUMA node when CPU groups were disabled no matter whether NUMA was
enabled or disabled. The refactoring fixed that by returning the
current CPU group number for the case when NUMA was enabled, however
it still returned incorrect value, this time GroupProcNo::NoGroup as
the NUMA node number in case NUMA was disabled.

This change fixes it by returning the current group number in this case.
src/gc/windows/gcenv.windows.cpp
src/vm/gcenv.os.cpp