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

@ -5175,7 +5175,8 @@ void os::Linux::numa_init() {
// bitmask when externally configured to run on all or fewer nodes.
if (!Linux::libnuma_init()) {
UseNUMA = false;
FLAG_SET_ERGO(UseNUMA, false);
FLAG_SET_ERGO(UseNUMAInterleaving, false); // Also depends on libnuma.
} else {
if ((Linux::numa_max_node() < 1) || Linux::is_bound_to_single_node()) {
// If there's only one node (they start from 0) or if the process
@ -5208,6 +5209,11 @@ void os::Linux::numa_init() {
}
}
// When NUMA requested, not-NUMA-aware allocations default to interleaving.
if (UseNUMA && !UseNUMAInterleaving) {
FLAG_SET_ERGO_IF_DEFAULT(UseNUMAInterleaving, true);
}
if (UseParallelGC && UseNUMA && UseLargePages && !can_commit_large_page_memory()) {
// With SHM and HugeTLBFS large pages we cannot uncommit a page, so there's no way
// we can make the adaptive lgrp chunk resizing work. If the user specified both
@ -5272,7 +5278,7 @@ jint os::init_2(void) {
log_info(os)("HotSpot is running with %s, %s",
Linux::glibc_version(), Linux::libpthread_version());
if (UseNUMA) {
if (UseNUMA || UseNUMAInterleaving) {
Linux::numa_init();
}