diff options
-rw-r--r-- | rts/RtsFlags.c | 6 | ||||
-rw-r--r-- | rts/posix/OSMem.c | 9 | ||||
-rw-r--r-- | rts/sm/OSMem.h | 1 | ||||
-rw-r--r-- | rts/win32/OSMem.c | 5 |
4 files changed, 21 insertions, 0 deletions
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index 461c41643c..7c292d2044 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -906,6 +906,12 @@ error = true; } #if defined(THREADED_RTS) else if (!strncmp("numa", &rts_argv[arg][2], 4)) { + if (!osBuiltWithNumaSupport()) { + errorBelch("%s: This GHC build was compiled without NUMA support.", + rts_argv[arg]); + error = true; + break; + } OPTION_SAFE; StgWord mask; if (rts_argv[arg][6] == '=') { diff --git a/rts/posix/OSMem.c b/rts/posix/OSMem.c index f603644375..9ecd53e9db 100644 --- a/rts/posix/OSMem.c +++ b/rts/posix/OSMem.c @@ -591,6 +591,15 @@ void osReleaseHeapMemory(void) #endif +bool osBuiltWithNumaSupport(void) +{ +#if HAVE_LIBNUMA + return true; +#else + return false; +#endif +} + bool osNumaAvailable(void) { #if HAVE_LIBNUMA diff --git a/rts/sm/OSMem.h b/rts/sm/OSMem.h index 3b0cee9630..7dd0efdc23 100644 --- a/rts/sm/OSMem.h +++ b/rts/sm/OSMem.h @@ -18,6 +18,7 @@ void osFreeAllMBlocks(void); size_t getPageSize (void); StgWord64 getPhysicalMemorySize (void); void setExecutable (void *p, W_ len, bool exec); +bool osBuiltWithNumaSupport(void); // See #14956 bool osNumaAvailable(void); uint32_t osNumaNodes(void); uint64_t osNumaMask(void); diff --git a/rts/win32/OSMem.c b/rts/win32/OSMem.c index d05151ce61..c62ee3b7a4 100644 --- a/rts/win32/OSMem.c +++ b/rts/win32/OSMem.c @@ -499,6 +499,11 @@ void osReleaseHeapMemory (void) #endif +bool osBuiltWithNumaSupport(void) +{ + return true; +} + bool osNumaAvailable(void) { return osNumaNodes() > 1; |