8243961: ForceNUMA and only one available NUMA node fails assertion on Windows

Improve ergnomics for UseNUMA and UseNUMAInterleaving

Reviewed-by: tschatzl, sjohanss
This commit is contained in:
Kim Barrett 2020-05-05 22:34:54 -04:00
parent 317bd88e33
commit 7ae3bea212
6 changed files with 28 additions and 19 deletions

View file

@ -4096,10 +4096,13 @@ jint os::init_2(void) {
UseNUMA = false; // We don't fully support this yet
}
if (UseNUMAInterleaving) {
// first check whether this Windows OS supports VirtualAllocExNuma, if not ignore this flag
bool success = numa_interleaving_init();
if (!success) UseNUMAInterleaving = false;
if (UseNUMAInterleaving || (UseNUMA && FLAG_IS_DEFAULT(UseNUMAInterleaving))) {
if (!numa_interleaving_init()) {
FLAG_SET_ERGO(UseNUMAInterleaving, false);
} else if (!UseNUMAInterleaving) {
// When NUMA requested, not-NUMA-aware allocations default to interleaving.
FLAG_SET_ERGO(UseNUMAInterleaving, true);
}
}
if (initSock() != JNI_OK) {