-
Notifications
You must be signed in to change notification settings - Fork 369
Allow systems without NUMA support to start up #7524
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,6 +47,10 @@ fd_numa_node_cnt( void ) { | |
| char const * path = "/sys/devices/system/node"; | ||
| DIR * dir = opendir( path ); | ||
| if( FD_UNLIKELY( !dir ) ) { | ||
| // On some systems (such as a Linux container running in Docker on a Mac), parts of the file system | ||
| // are not set up the way we expect it to be on Linux. E.g., `/sys/devices/system/node` does not | ||
| // exist - if we are in such a system, assume that we only have a single NUMA node and continue | ||
| if ( errno == ENOENT ) return 1UL; | ||
| FD_LOG_WARNING(( "opendir( \"%s\" ) failed (%i-%s)", path, errno, fd_io_strerror( errno ) )); | ||
| return 0UL; | ||
| } | ||
|
|
@@ -118,8 +122,8 @@ fd_numa_node_idx( ulong cpu_idx ) { | |
| FD_LOG_WARNING(( "closedir( \"%s\" ) failed (%i-%s); attempting to continue", path, errno, fd_io_strerror( errno ) )); | ||
|
|
||
| if( FD_UNLIKELY( node_idx<0 ) ) { | ||
| FD_LOG_WARNING(( "No numa node found in \"%s\"", path )); | ||
| return ULONG_MAX; | ||
| FD_LOG_WARNING(( "No numa node found in \"%s\" - assuming NUMA node 0", path )); | ||
| return 0UL; | ||
| } | ||
|
|
||
| return (ulong)node_idx; | ||
|
|
@@ -178,6 +182,10 @@ fd_numa_get_mempolicy( int * mode, | |
| void * addr, | ||
| uint flags ) { | ||
| long rc = syscall( SYS_get_mempolicy, mode, nodemask, maxnode, addr, flags ); | ||
| if ( rc && errno == ENOSYS ) { | ||
| FD_LOG_WARNING(( "System appears to not support NUMA - unable to get mempolicy. Attempting to continue..." )); | ||
| return 0L; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without this change, we are unable to create a workspace due to the following in |
||
| } | ||
| if( rc==0 ) { | ||
| if( mode ) fd_msan_unpoison( mode, sizeof(int) ); | ||
| if( nodemask ) fd_msan_unpoison( nodemask, 8UL*((maxnode+63UL)/64UL) ); | ||
|
|
@@ -189,7 +197,12 @@ long | |
| fd_numa_set_mempolicy( int mode, | ||
| ulong const * nodemask, | ||
| ulong maxnode ) { | ||
| return syscall( SYS_set_mempolicy, mode, nodemask, maxnode ); | ||
| long rc = syscall( SYS_set_mempolicy, mode, nodemask, maxnode ); | ||
| if ( rc && errno == ENOSYS ) { | ||
| FD_LOG_WARNING(( "System appears to not support NUMA - unable to set mempolicy. Attempting to continue..." )); | ||
| return 0L; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without this change, we are unable to create a workspace due to the following in |
||
| } | ||
| return rc; | ||
| } | ||
|
|
||
| long | ||
|
|
@@ -199,7 +212,12 @@ fd_numa_mbind( void * addr, | |
| ulong const * nodemask, | ||
| ulong maxnode, | ||
| uint flags ) { | ||
| return syscall( SYS_mbind, addr, len, mode, nodemask, maxnode, flags ); | ||
| long rc = syscall( SYS_mbind, addr, len, mode, nodemask, maxnode, flags ); | ||
| if ( rc && errno == ENOSYS ) { | ||
| FD_LOG_WARNING(( "System appears to not support NUMA - unable to bind memory. Attempting to continue..." )); | ||
| return 0L; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without this change, we are unable to create a workspace due to the following in |
||
| } | ||
| return rc; | ||
| } | ||
|
|
||
| long | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this change,
fd_shmem_private_boot(run as part offd_boot) would fail due to: