--- old/src/hotspot/os/aix/os_aix.cpp 2020-05-02 05:24:27.990484263 -0400 +++ new/src/hotspot/os/aix/os_aix.cpp 2020-05-02 05:24:27.682474342 -0400 @@ -3549,10 +3549,9 @@ return JNI_ERR; } - if (UseNUMA) { - UseNUMA = false; - warning("NUMA optimizations are not available on this OS."); - } + // Not supported. + FLAG_SET_ERGO(UseNUMA, false); + FLAG_SET_ERGO(UseNUMAInterleaving, false); if (MaxFDLimit) { // Set the number of file descriptors to max. print out error --- old/src/hotspot/os/bsd/os_bsd.cpp 2020-05-02 05:24:29.114520470 -0400 +++ new/src/hotspot/os/bsd/os_bsd.cpp 2020-05-02 05:24:28.746508616 -0400 @@ -3140,6 +3140,10 @@ return JNI_ERR; } + // Not supported. + FLAG_SET_ERGO(UseNUMA, false); + FLAG_SET_ERGO(UseNUMAInterleaving, false); + if (MaxFDLimit) { // set the number of file descriptors to max. print out error // if getrlimit/setrlimit fails but continue regardless. --- old/src/hotspot/os/linux/os_linux.cpp 2020-05-02 05:24:30.226556291 -0400 +++ new/src/hotspot/os/linux/os_linux.cpp 2020-05-02 05:24:29.862544566 -0400 @@ -5175,7 +5175,8 @@ // 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 @@ } } + // 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 @@ log_info(os)("HotSpot is running with %s, %s", Linux::glibc_version(), Linux::libpthread_version()); - if (UseNUMA) { + if (UseNUMA || UseNUMAInterleaving) { Linux::numa_init(); } --- old/src/hotspot/os/solaris/os_solaris.cpp 2020-05-02 05:24:31.342592240 -0400 +++ new/src/hotspot/os/solaris/os_solaris.cpp 2020-05-02 05:24:30.978580515 -0400 @@ -3916,7 +3916,7 @@ if (UseNUMA) { if (!Solaris::liblgrp_init()) { - UseNUMA = false; + FLAG_SET_ERGO(UseNUMA, false); } else { size_t lgrp_limit = os::numa_get_groups_num(); int *lgrp_ids = NEW_C_HEAP_ARRAY(int, lgrp_limit, mtInternal); @@ -3930,6 +3930,11 @@ } } + // When NUMA requested, not-NUMA-aware allocations default to interleaving. + if (UseNUMA && !UseNUMAInterleaving) { + FLAG_SET_ERGO_IF_DEFAULT(UseNUMAInterleaving, true); + } + Solaris::signal_sets_init(); Solaris::init_signal_mem(); Solaris::install_signal_handlers(); --- old/src/hotspot/os/windows/os_windows.cpp 2020-05-02 05:24:32.458628191 -0400 +++ new/src/hotspot/os/windows/os_windows.cpp 2020-05-02 05:24:32.090616336 -0400 @@ -4096,10 +4096,13 @@ 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) { --- old/src/hotspot/share/runtime/arguments.cpp 2020-05-02 05:24:33.570664011 -0400 +++ new/src/hotspot/share/runtime/arguments.cpp 2020-05-02 05:24:33.214652543 -0400 @@ -4158,14 +4158,6 @@ FLAG_SET_DEFAULT(MinHeapDeltaBytes, 64*M); } } - // UseNUMAInterleaving is set to ON for all collectors and platforms when - // UseNUMA is set to ON. NUMA-aware collectors will interleave old gen and - // survivor spaces on top of NUMA allocation policy for the eden space. - // Non NUMA-aware collectors will interleave all of the heap spaces across - // NUMA nodes. - if (FLAG_IS_DEFAULT(UseNUMAInterleaving)) { - FLAG_SET_ERGO(UseNUMAInterleaving, true); - } } return JNI_OK; }