Line data Source code
1 : #define _GNU_SOURCE 2 : #include "fddev.h" 3 : 4 : void 5 : initialize_workspaces( config_t * const config ); 6 : 7 : void 8 : wksp_cmd_perm( args_t * args, 9 : fd_caps_ctx_t * caps, 10 0 : config_t * const config ) { 11 0 : (void)args; 12 : 13 0 : ulong mlock_limit = 0UL; 14 0 : for( ulong i=0UL; i<config->topo.wksp_cnt; i++ ) { 15 0 : fd_topo_wksp_t * wksp = &config->topo.workspaces[ i ]; 16 0 : mlock_limit = fd_ulong_max( mlock_limit, wksp->page_cnt * wksp->page_sz ); 17 0 : } 18 : /* One 4K page is used by the logging lock */ 19 0 : fd_caps_check_resource( caps, "wksp", RLIMIT_MEMLOCK, mlock_limit+4096UL, "call `rlimit(2)` to increase `RLIMIT_MEMLOCK` so all memory can be locked with `mlock(2)`" ); 20 0 : } 21 : 22 : void 23 : wksp_cmd_fn( args_t * args, 24 0 : config_t * const config ) { 25 0 : (void)args; 26 : 27 0 : initialize_workspaces( config ); 28 0 : exit_group( 0 ); 29 0 : }