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)
commit8a3663ff148e18e2caa2e86bfe9eb8a98658be3d
tree16feda54c8c9458d6193fe778301bc78d5bd175d
parent7f743795f4069728bf45a3fc7d38bf0beb062529
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.

Commit migrated from https://github.com/dotnet/coreclr/commit/8d93bd9080f47efd87dc5420a6e600f8dc432659
src/coreclr/src/gc/windows/gcenv.windows.cpp
src/coreclr/src/vm/gcenv.os.cpp