Skip to content

Commit 1ae013a

Browse files
funk, topo, util: make Funk workspace use unpinned pages
1 parent bc50382 commit 1ae013a

File tree

19 files changed

+260
-48
lines changed

19 files changed

+260
-48
lines changed

contrib/offline-replay/offline_replay.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@
4040
[paths]
4141
identity_key = "{identity_key_path}"
4242
vote_account = "{vote_account_path}"
43+
[hugetlbfs]
44+
mount_path = "/data/firedancer/mnt"

src/app/firedancer/topology.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,10 @@ setup_topo_funk( fd_topo_t * topo,
111111
ulong wksp_idx = fd_topo_find_wksp( topo, wksp_name );
112112
FD_TEST( wksp_idx!=ULONG_MAX );
113113
fd_topo_wksp_t * wksp = &topo->workspaces[ wksp_idx ];
114-
ulong part_max = fd_wksp_part_max_est( funk_footprint, 1U<<14U );
114+
ulong part_max = fd_wksp_part_max_est( funk_footprint+(heap_size_gib*(1UL<<30)), 1U<<14U );
115115
if( FD_UNLIKELY( !part_max ) ) FD_LOG_ERR(( "fd_wksp_part_max_est(%lu,16KiB) failed", funk_footprint ));
116116
wksp->part_max += part_max;
117+
wksp->is_locked = 0;
117118

118119
return obj;
119120
}

src/app/shared/commands/configure/hugetlbfs.c

Lines changed: 72 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,15 @@ init( config_t const * config ) {
151151
they are not, creating files in the mount on a specific node may
152152
fail later with ENOMEM. */
153153

154+
FD_LOG_NOTICE(( "RUN: `mkdir -p %s`", config->hugetlbfs.mount_path ));
155+
if( FD_UNLIKELY( -1==fd_file_util_mkdir_all( config->hugetlbfs.mount_path, config->uid, config->gid ) ) ) {
156+
FD_LOG_ERR(( "could not create hugetlbfs mount directory `%s` (%i-%s)", config->hugetlbfs.mount_path, errno, fd_io_strerror( errno ) ));
157+
}
158+
if( FD_UNLIKELY( chown( config->hugetlbfs.mount_path, config->uid, config->gid ) ) )
159+
FD_LOG_ERR(( "chown of hugetlbfs mount directory at `%s` failed (%i-%s)", config->hugetlbfs.mount_path, errno, fd_io_strerror( errno ) ));
160+
if( FD_UNLIKELY( chmod( config->hugetlbfs.mount_path, S_IRUSR | S_IWUSR | S_IXUSR ) ) )
161+
FD_LOG_ERR(( "chmod of hugetlbfs mount directory at `%s` failed (%i-%s)", config->hugetlbfs.mount_path, errno, fd_io_strerror( errno ) ));
162+
154163
ulong min_size[ 2 ] = {0};
155164
for( ulong i=0UL; i<numa_node_cnt; i++ ) {
156165
min_size[ 0 ] += PAGE_SIZE[ 0 ] * fd_topo_huge_page_cnt( &config->topo, i, 0 );
@@ -173,6 +182,16 @@ init( config_t const * config ) {
173182
if( FD_UNLIKELY( chmod( mount_path[ i ], S_IRUSR | S_IWUSR | S_IXUSR ) ) )
174183
FD_LOG_ERR(( "chmod of hugetlbfs at `%s` failed (%i-%s)", mount_path[ i ], errno, fd_io_strerror( errno ) ));
175184
}
185+
186+
/* Create the directory for the normal pages, which is not a hugetlbfs mount. */
187+
FD_LOG_NOTICE(( "RUN: `mkdir -p %s`", config->hugetlbfs.normal_page_mount_path ));
188+
if( FD_UNLIKELY( -1==fd_file_util_mkdir_all( config->hugetlbfs.normal_page_mount_path, config->uid, config->gid ) ) ) {
189+
FD_LOG_ERR(( "could not create mount directory `%s` (%i-%s)", config->hugetlbfs.normal_page_mount_path, errno, fd_io_strerror( errno ) ));
190+
}
191+
if( FD_UNLIKELY( chown( config->hugetlbfs.normal_page_mount_path, config->uid, config->gid ) ) )
192+
FD_LOG_ERR(( "chown of hugetlbfs at `%s` failed (%i-%s)", config->hugetlbfs.normal_page_mount_path, errno, fd_io_strerror( errno ) ));
193+
if( FD_UNLIKELY( chmod( config->hugetlbfs.normal_page_mount_path, S_IRUSR | S_IWUSR | S_IXUSR ) ) )
194+
FD_LOG_ERR(( "chmod of hugetlbfs at `%s` failed (%i-%s)", config->hugetlbfs.normal_page_mount_path, errno, fd_io_strerror( errno ) ));
176195
}
177196

178197
static void
@@ -225,6 +244,32 @@ warn_mount_users( char const * mount_path ) {
225244
if( FD_UNLIKELY( -1==closedir( dir ) ) ) FD_LOG_ERR(( "closedir (%i-%s)", errno, fd_io_strerror( errno ) ));
226245
}
227246

247+
/* Removes all top-level files in the given directory. */
248+
static int
249+
empty_dir_top_level( const char *dir_path ) {
250+
DIR *dir = opendir( dir_path );
251+
if( FD_UNLIKELY( !dir ) ) return (errno == ENOENT) ? 0 : -1;
252+
253+
struct dirent *entry;
254+
while( ( entry = readdir(dir) ) ) {
255+
if( FD_UNLIKELY( !strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..") ) ) continue;
256+
257+
char path[PATH_MAX];
258+
FD_TEST( fd_cstr_printf_check( path, PATH_MAX, NULL, "%s/%s", dir_path, entry->d_name ) );
259+
260+
struct stat st;
261+
if( stat(path, &st) == 0 && S_ISREG(st.st_mode)) {
262+
FD_LOG_NOTICE(( "RUN: `rm %s`", path ));
263+
if( FD_UNLIKELY( unlink(path) && errno != ENOENT ) ) {
264+
FD_LOG_WARNING(( "failed to remove file `%s` (%i-%s)", path, errno, fd_io_strerror(errno) ));
265+
}
266+
}
267+
}
268+
269+
if( FD_UNLIKELY( -1==closedir( dir ) ) ) FD_LOG_ERR(( "closedir (%i-%s)", errno, fd_io_strerror( errno ) ));
270+
return 0;
271+
}
272+
228273
static void
229274
fini( config_t const * config,
230275
int pre_init ) {
@@ -233,16 +278,12 @@ fini( config_t const * config,
233278
/* Not used by fdctl but might be created by other debugging tools
234279
on the system. */
235280

236-
char normal_page_mount_path[ PATH_MAX ];
237-
FD_TEST( fd_cstr_printf_check( normal_page_mount_path, PATH_MAX, NULL, "%s/.normal", config->hugetlbfs.mount_path ) );
238-
239-
const char * mount_path[ 3 ] = {
281+
const char * mount_path[ 2 ] = {
240282
config->hugetlbfs.huge_page_mount_path,
241283
config->hugetlbfs.gigantic_page_mount_path,
242-
normal_page_mount_path,
243284
};
244285

245-
for( ulong i=0UL; i<3UL; i++ ) {
286+
for( ulong i=0UL; i<2UL; i++ ) {
246287
FILE * fp = fopen( "/proc/self/mounts", "r" );
247288
if( FD_UNLIKELY( !fp ) ) FD_LOG_ERR(( "failed to open `/proc/self/mounts`" ));
248289

@@ -276,16 +317,33 @@ fini( config_t const * config,
276317
FD_LOG_ERR(( "error removing hugetlbfs mount at `%s` (%i-%s)", mount_path[ i ], errno, fd_io_strerror( errno ) ));
277318
}
278319

320+
/* The normal pages mount directory is not a hugetlbfs mount, so we need to handle it separately. */
321+
/* In some cases, the normal pages mount directory has been mounted by a different process, so we
322+
umount it just to be on the safe side. */
323+
if( FD_UNLIKELY( !umount( config->hugetlbfs.normal_page_mount_path ) ) ) {
324+
FD_LOG_DEBUG(( "error unmounting hugetlbfs normal pages directory at `%s` (%i-%s). this is expected in normal operation",
325+
config->hugetlbfs.normal_page_mount_path, errno, fd_io_strerror( errno ) ));
326+
}
327+
if( FD_UNLIKELY( empty_dir_top_level(config->hugetlbfs.normal_page_mount_path) && errno != ENOENT ) )
328+
FD_LOG_ERR(( "error emptying hugetlbfs normal pages directory at `%s` (%i-%s)",
329+
config->hugetlbfs.normal_page_mount_path, errno, fd_io_strerror(errno) ));
330+
331+
FD_LOG_NOTICE(( "RUN: `rmdir %s`", config->hugetlbfs.normal_page_mount_path ));
332+
if( FD_UNLIKELY( rmdir( config->hugetlbfs.normal_page_mount_path ) && errno!=ENOENT ) )
333+
FD_LOG_ERR(( "error removing hugetlbfs normal pages directory at `%s` (%i-%s)",
334+
config->hugetlbfs.normal_page_mount_path, errno, fd_io_strerror( errno ) ));
335+
279336
FD_LOG_NOTICE(( "RUN: `rmdir %s`", config->hugetlbfs.mount_path ));
280337
if( FD_UNLIKELY( rmdir( config->hugetlbfs.mount_path ) && errno!=ENOENT ) )
281338
FD_LOG_ERR(( "error removing hugetlbfs directory at `%s` (%i-%s)", config->hugetlbfs.mount_path, errno, fd_io_strerror( errno ) ));
282339
}
283340

284341
static configure_result_t
285342
check( config_t const * config ) {
286-
char const * mount_path[ 2 ] = {
343+
char const * mount_path[ 3 ] = {
287344
config->hugetlbfs.huge_page_mount_path,
288345
config->hugetlbfs.gigantic_page_mount_path,
346+
config->hugetlbfs.normal_page_mount_path,
289347
};
290348

291349
static char const * MOUNT_PAGE_SIZE[ 2 ] = {
@@ -307,13 +365,18 @@ check( config_t const * config ) {
307365
int result2 = stat( mount_path[ 1 ], &st );
308366
if( FD_UNLIKELY( result2 && errno!=ENOENT ) )
309367
PARTIALLY_CONFIGURED( "failed to stat `%s` (%i-%s)", mount_path[ 1 ], errno, fd_io_strerror( errno ) );
368+
int result3 = stat( mount_path[ 2 ], &st );
369+
if( FD_UNLIKELY( result3 && errno!=ENOENT ) )
370+
PARTIALLY_CONFIGURED( "failed to stat `%s` (%i-%s)", mount_path[ 2 ], errno, fd_io_strerror( errno ) );
310371

311-
if( FD_UNLIKELY( result1 && result2 ) )
312-
NOT_CONFIGURED( "mounts `%s` and `%s` do not exist", mount_path[ 0 ], mount_path[ 1 ] );
372+
if( FD_UNLIKELY( result1 && result2 && result3 ) )
373+
NOT_CONFIGURED( "mounts `%s`, `%s` and `%s` do not exist", mount_path[ 0 ], mount_path[ 1 ], mount_path[ 2 ] );
313374
else if( FD_UNLIKELY( result1 ) )
314375
PARTIALLY_CONFIGURED( "mount `%s` does not exist", mount_path[ 0 ] );
315376
else if( FD_UNLIKELY( result2 ) )
316377
PARTIALLY_CONFIGURED( "mount `%s` does not exist", mount_path[ 1 ] );
378+
else if( FD_UNLIKELY( result3 ) )
379+
PARTIALLY_CONFIGURED( "mount `%s` does not exist", mount_path[ 2 ] );
317380

318381
CHECK( check_dir( config->hugetlbfs.mount_path, config->uid, config->gid, S_IFDIR | S_IRUSR | S_IWUSR | S_IXUSR ) );
319382
for( ulong i=0UL; i<2UL; i++ ) {

src/app/shared/commands/run/run.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,9 @@ workspace_path( config_t const * config,
472472
case FD_SHMEM_GIGANTIC_PAGE_SZ:
473473
mount_path = config->hugetlbfs.gigantic_page_mount_path;
474474
break;
475+
case FD_SHMEM_NORMAL_PAGE_SZ:
476+
mount_path = config->hugetlbfs.normal_page_mount_path;
477+
break;
475478
default:
476479
FD_LOG_ERR(( "invalid page size %lu", wksp->page_sz ));
477480
}
@@ -511,6 +514,7 @@ warn_unknown_files( config_t const * config,
511514
int known_file = 0;
512515
for( ulong i=0UL; i<config->topo.wksp_cnt; i++ ) {
513516
fd_topo_wksp_t const * wksp = &config->topo.workspaces[ i ];
517+
if( !wksp->is_locked ) continue;
514518

515519
char expected_path[ PATH_MAX ];
516520
workspace_path( config, wksp, expected_path );

src/app/shared/fd_config.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,11 @@ fd_config_fill( fd_config_t * config,
292292
NULL,
293293
"%s/.huge",
294294
config->hugetlbfs.mount_path ) );
295+
FD_TEST( fd_cstr_printf_check( config->hugetlbfs.normal_page_mount_path,
296+
sizeof(config->hugetlbfs.normal_page_mount_path),
297+
NULL,
298+
"%s/.normal",
299+
config->hugetlbfs.mount_path ) );
295300

296301
ulong max_page_sz = fd_cstr_to_shmem_page_sz( config->hugetlbfs.max_page_size );
297302
if( FD_UNLIKELY( max_page_sz!=FD_SHMEM_HUGE_PAGE_SZ && max_page_sz!=FD_SHMEM_GIGANTIC_PAGE_SZ ) ) FD_LOG_ERR(( "[hugetlbfs.max_page_size] must be \"huge\" or \"gigantic\"" ));

src/app/shared/fd_config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ struct fd_config {
241241
struct {
242242
char gigantic_page_mount_path[ PATH_MAX ];
243243
char huge_page_mount_path[ PATH_MAX ];
244+
char normal_page_mount_path[ PATH_MAX ];
244245
char mount_path[ PATH_MAX ];
245246
char max_page_size[ 16 ];
246247
ulong gigantic_page_threshold_mib;

src/disco/topo/fd_topo.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fd_topo_join_workspace( fd_topo_t * topo,
1717
char name[ PATH_MAX ];
1818
FD_TEST( fd_cstr_printf_check( name, PATH_MAX, NULL, "%s_%s.wksp", topo->app_name, wksp->name ) );
1919

20-
wksp->wksp = fd_wksp_join( fd_shmem_join( name, mode, NULL, NULL, NULL ) );
20+
wksp->wksp = fd_wksp_join( fd_shmem_join( name, mode, NULL, NULL, NULL, wksp->is_locked ) );
2121
if( FD_UNLIKELY( !wksp->wksp ) ) FD_LOG_ERR(( "fd_wksp_join failed" ));
2222
}
2323

@@ -82,15 +82,17 @@ fd_topo_create_workspace( fd_topo_t * topo,
8282
ulong sub_cpu_idx [ 1 ] = { fd_shmem_cpu_idx( wksp->numa_idx ) };
8383

8484
int err;
85-
if( FD_UNLIKELY( update_existing ) ) {
85+
if( FD_UNLIKELY( !wksp->is_locked ) ) {
86+
err = fd_shmem_create_multi_unlocked( name, wksp->page_sz, wksp->page_cnt, S_IRUSR | S_IWUSR ); /* logs details */
87+
} else if( FD_UNLIKELY( update_existing ) ) {
8688
err = fd_shmem_update_multi( name, wksp->page_sz, 1, sub_page_cnt, sub_cpu_idx, S_IRUSR | S_IWUSR ); /* logs details */
8789
} else {
8890
err = fd_shmem_create_multi( name, wksp->page_sz, 1, sub_page_cnt, sub_cpu_idx, S_IRUSR | S_IWUSR ); /* logs details */
8991
}
9092
if( FD_UNLIKELY( err && errno==ENOMEM ) ) return -1;
9193
else if( FD_UNLIKELY( err ) ) FD_LOG_ERR(( "fd_shmem_create_multi failed" ));
9294

93-
void * shmem = fd_shmem_join( name, FD_SHMEM_JOIN_MODE_READ_WRITE, NULL, NULL, NULL ); /* logs details */
95+
void * shmem = fd_shmem_join( name, FD_SHMEM_JOIN_MODE_READ_WRITE, NULL, NULL, NULL, wksp->is_locked ); /* logs details */
9496

9597
void * wkspmem = fd_wksp_new( shmem, name, 0U, wksp->part_max, wksp->total_footprint ); /* logs details */
9698
if( FD_UNLIKELY( !wkspmem ) ) FD_LOG_ERR(( "fd_wksp_new failed" ));
@@ -223,6 +225,8 @@ fd_topo_mlock_max_tile1( fd_topo_t const * topo,
223225
ulong tile_mem = 0UL;
224226

225227
for( ulong i=0UL; i<topo->wksp_cnt; i++ ) {
228+
if( FD_UNLIKELY( !topo->workspaces[ i ].is_locked ) ) continue;
229+
226230
if( FD_UNLIKELY( -1!=tile_needs_wksp( topo, tile, i ) ) )
227231
tile_mem += topo->workspaces[ i ].page_cnt * topo->workspaces[ i ].page_sz;
228232
}
@@ -250,6 +254,7 @@ fd_topo_gigantic_page_cnt( fd_topo_t const * topo,
250254
for( ulong i=0UL; i<topo->wksp_cnt; i++ ) {
251255
fd_topo_wksp_t const * wksp = &topo->workspaces[ i ];
252256
if( FD_LIKELY( wksp->numa_idx!=numa_idx ) ) continue;
257+
if( FD_UNLIKELY( !wksp->is_locked ) ) continue;
253258

254259
if( FD_LIKELY( wksp->page_sz==FD_SHMEM_GIGANTIC_PAGE_SZ ) ) {
255260
result += wksp->page_cnt;
@@ -266,6 +271,7 @@ fd_topo_huge_page_cnt( fd_topo_t const * topo,
266271
for( ulong i=0UL; i<topo->wksp_cnt; i++ ) {
267272
fd_topo_wksp_t const * wksp = &topo->workspaces[ i ];
268273
if( FD_LIKELY( wksp->numa_idx!=numa_idx ) ) continue;
274+
if( FD_UNLIKELY( !wksp->is_locked ) ) continue;
269275

270276
if( FD_LIKELY( wksp->page_sz==FD_SHMEM_HUGE_PAGE_SZ ) ) {
271277
result += wksp->page_cnt;
@@ -296,6 +302,7 @@ FD_FN_PURE ulong
296302
fd_topo_mlock( fd_topo_t const * topo ) {
297303
ulong result = 0UL;
298304
for( ulong i=0UL; i<topo->wksp_cnt; i++ ) {
305+
if( FD_UNLIKELY( !topo->workspaces[ i ].is_locked ) ) continue;
299306
result += topo->workspaces[ i ].page_cnt * topo->workspaces[ i ].page_sz;
300307
}
301308
return result;
@@ -385,7 +392,7 @@ fd_topo_print_log( int stdout,
385392

386393
char size[ 24 ];
387394
fd_topo_mem_sz_string( wksp->page_sz * wksp->page_cnt, size );
388-
PRINT( " %2lu (%7s): %12s page_cnt=%3lu page_sz=%-8s numa_idx=%-2lu footprint=%10lu loose=%lu\n", i, size, wksp->name, wksp->page_cnt, fd_shmem_page_sz_to_cstr( wksp->page_sz ), wksp->numa_idx, wksp->known_footprint, wksp->total_footprint - wksp->known_footprint );
395+
PRINT( " %2lu (%7s): %12s page_cnt=%3lu page_sz=%-8s numa_idx=%-2lu footprint=%10lu loose=%10lu is_locked=%d\n", i, size, wksp->name, wksp->page_cnt, fd_shmem_page_sz_to_cstr( wksp->page_sz ), wksp->numa_idx, wksp->known_footprint, wksp->total_footprint - wksp->known_footprint, wksp->is_locked );
389396
}
390397

391398
PRINT( "\nOBJECTS\n" );

src/disco/topo/fd_topo.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,17 @@
3030
sits on top of 1 or more memory mapped gigantic or huge pages mounted
3131
to the hugetlbfs. */
3232
typedef struct {
33-
ulong id; /* The ID of this workspace. Indexed from [0, wksp_cnt). When placed in a topology, the ID must be the index of the workspace in the workspaces list. */
34-
char name[ 13UL ]; /* The name of this workspace, like "pack". There can be at most one of each workspace name in a topology. */
33+
ulong id; /* The ID of this workspace. Indexed from [0, wksp_cnt). When placed in a topology, the ID must be the index of the workspace in the workspaces list. */
34+
char name[ 13UL ]; /* The name of this workspace, like "pack". There can be at most one of each workspace name in a topology. */
3535

36-
ulong numa_idx; /* The index of the NUMA node on the system that this workspace should be allocated from. */
36+
ulong numa_idx; /* The index of the NUMA node on the system that this workspace should be allocated from. */
3737

3838
/* Computed fields. These are not supplied as configuration but calculated as needed. */
3939
struct {
40-
ulong page_sz; /* The size of the pages that this workspace is backed by. One of FD_PAGE_SIZE_*. */
41-
ulong page_cnt; /* The number of pages that must be mapped to this workspace to store all the data needed by consumers. */
42-
ulong part_max; /* The maximum number of partitions in the underlying workspace. There can only be this many allocations made at any one time. */
40+
ulong page_sz; /* The size of the pages that this workspace is backed by. One of FD_PAGE_SIZE_*. */
41+
ulong page_cnt; /* The number of pages that must be mapped to this workspace to store all the data needed by consumers. */
42+
int is_locked; /* If the workspace should use pages locked and pinned to a specific numa node. */
43+
ulong part_max; /* The maximum number of partitions in the underlying workspace. There can only be this many allocations made at any one time. */
4344

4445
fd_wksp_t * wksp; /* The workspace memory in the local process. */
4546
ulong known_footprint; /* Total size in bytes of all data in Firedancer that will be stored in this workspace at startup. */

src/disco/topo/fd_topo_run.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ fd_topo_tile_stack_join( char const * app_name,
228228
char name[ PATH_MAX ];
229229
FD_TEST( fd_cstr_printf_check( name, PATH_MAX, NULL, "%s_stack_%s%lu", app_name, tile_name, tile_kind_id ) );
230230

231-
uchar * stack = fd_shmem_join( name, FD_SHMEM_JOIN_MODE_READ_WRITE, NULL, NULL, NULL );
231+
uchar * stack = fd_shmem_join( name, FD_SHMEM_JOIN_MODE_READ_WRITE, NULL, NULL, NULL, 1 );
232232
if( FD_UNLIKELY( !stack ) ) FD_LOG_ERR(( "fd_shmem_join failed" ));
233233

234234
/* Make space for guard lo and guard hi */

src/disco/topo/fd_topob.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ fd_topob_wksp( fd_topo_t * topo,
4141
fd_topo_wksp_t * wksp = &topo->workspaces[ topo->wksp_cnt ];
4242
strncpy( wksp->name, name, sizeof(wksp->name) );
4343
wksp->id = topo->wksp_cnt;
44+
wksp->is_locked = 1;
4445
topo->wksp_cnt++;
4546
}
4647

@@ -644,6 +645,11 @@ fd_topob_finish( fd_topo_t * topo,
644645
if( total_wksp_footprint < topo->gigantic_page_threshold ) page_sz = FD_SHMEM_HUGE_PAGE_SZ;
645646
if( FD_UNLIKELY( page_sz!=FD_SHMEM_HUGE_PAGE_SZ && page_sz!=FD_SHMEM_GIGANTIC_PAGE_SZ ) ) FD_LOG_ERR(( "invalid page_sz" ));
646647

648+
/* If the workspace is not locked, we can't use huge pages. */
649+
if( FD_UNLIKELY( !wksp->is_locked ) ) {
650+
page_sz = FD_SHMEM_NORMAL_PAGE_SZ;
651+
}
652+
647653
ulong wksp_aligned_footprint = fd_ulong_align_up( total_wksp_footprint, page_sz );
648654

649655
/* Give any leftover space in the underlying shared memory to the

0 commit comments

Comments
 (0)