diff options
author | Adeel Mujahid <3840695+am11@users.noreply.github.com> | 2021-02-19 04:41:07 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-19 04:41:07 +0300 |
commit | 1db079d19538a7520ec6c74f0566b4b78c7e935d (patch) | |
tree | 5f97b660ee18cd84a7e902180da9862baa131aea /src/coreclr/gc | |
parent | e712bfc008e6ce728408fdcbea95f29925b2337f (diff) |
Probe libnuma.so.1.0.0 before its symlinks (#48133)
On Linux, libnuma.so{.1} are symlinks to libnuma.so.1.0.0.
When installed from default package manager; Ubuntu (libnuma-dev) and
Alpine (numactl-dev), found these two symlinks:
`{libnuma.so,libnuma.so.1} -> libnuma.so.1.0.0`
On Fedora (numactl-libs):
`libnuma.so.1 -> libnuma.so.1.0.0`
(there is no version-less variant)
PR adjusts probing fallback flow based on this info.
Diffstat (limited to 'src/coreclr/gc')
-rw-r--r-- | src/coreclr/gc/unix/gcenv.unix.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/coreclr/gc/unix/gcenv.unix.cpp b/src/coreclr/gc/unix/gcenv.unix.cpp index 4a3c5830219..ecef1520812 100644 --- a/src/coreclr/gc/unix/gcenv.unix.cpp +++ b/src/coreclr/gc/unix/gcenv.unix.cpp @@ -284,10 +284,14 @@ void NUMASupportInitialize() return; } - g_numaHandle = dlopen("libnuma.so", RTLD_LAZY); + g_numaHandle = dlopen("libnuma.so.1", RTLD_LAZY); if (g_numaHandle == 0) { - g_numaHandle = dlopen("libnuma.so.1", RTLD_LAZY); + g_numaHandle = dlopen("libnuma.so.1.0.0", RTLD_LAZY); + if (g_numaHandle == 0) + { + g_numaHandle = dlopen("libnuma.so", RTLD_LAZY); + } } if (g_numaHandle != 0) { @@ -887,10 +891,10 @@ static size_t GetLogicalProcessorCacheSizeFromOS() if (cacheSize == 0) { // - // Fallback to retrieve cachesize via /sys/.. if sysconf was not available - // for the platform. Currently musl and arm64 should be only cases to use + // Fallback to retrieve cachesize via /sys/.. if sysconf was not available + // for the platform. Currently musl and arm64 should be only cases to use // this method to determine cache size. - // + // size_t size; if (ReadMemoryValueFromFile("/sys/devices/system/cpu/cpu0/cache/index0/size", &size)) |