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 FD_PARAM_UNUSED, 9 : fd_caps_ctx_t * caps, 10 0 : config_t const * config ) { 11 0 : ulong mlock_limit = 0UL; 12 0 : for( ulong i=0UL; i<config->topo.wksp_cnt; i++ ) { 13 0 : fd_topo_wksp_t const * wksp = &config->topo.workspaces[ i ]; 14 0 : mlock_limit = fd_ulong_max( mlock_limit, wksp->page_cnt * wksp->page_sz ); 15 0 : } 16 : /* One 4K page is used by the logging lock */ 17 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)`" ); 18 0 : } 19 : 20 : void 21 : wksp_cmd_fn( args_t * args, 22 0 : config_t * const config ) { 23 0 : (void)args; 24 : 25 0 : initialize_workspaces( config ); 26 0 : exit_group( 0 ); 27 0 : }