Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Probe libnuma.so.1.0.0 before its symlinks #48133

Merged
merged 1 commit into from
Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/coreclr/gc/unix/gcenv.unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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))
Expand Down
8 changes: 6 additions & 2 deletions src/coreclr/pal/src/numa/numa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,14 @@ NUMASupportInitialize()
return TRUE;
}

numaHandle = dlopen("libnuma.so", RTLD_LAZY);
numaHandle = dlopen("libnuma.so.1", RTLD_LAZY);
if (numaHandle == 0)
{
numaHandle = dlopen("libnuma.so.1", RTLD_LAZY);
numaHandle = dlopen("libnuma.so.1.0.0", RTLD_LAZY);
if (numaHandle == 0)
{
numaHandle = dlopen("libnuma.so", RTLD_LAZY);
}
}
if (numaHandle != 0)
{
Expand Down