svc_set_pool_threads(9)
π svc_set_pool_threads(9) β the kernel API manual, but make it make sense
okay so bestie, we're in the Kernel API Manual today and this one is called svc_set_pool_threads(9) β yes it's a mouthful, yes it's iconic, stay with me π«Ά
β¨ NAME β¨
svc_set_pool_threads β adjust number of threads per pool
π SYNOPSIS π
int svc_set_pool_threads (struct svc_serv *serv , struct svc_pool *pool
, unsigned int min_threads , unsigned int max_threads );
π¦ ARGUMENTS π¦
servβ the RPC service you're adjusting, bestie. that's the main character here πpoolβ the specific pool you're choosing threads from, like picking your faves out of the group chatmin_threadsβ min number of threads to run in pool (the floor, the bare minimum, the "i'm not getting out of bed for less than this")max_threadsβ max number of threads in pool, and heads up:0means kill all threads π yeah. zero. all of them. gone.
πΈ DESCRIPTION πΈ
So what this does is create or destroy threads in the pool to bring it into an acceptable range between min_threads and max_threads. Like a vibe check for your thread count β too few, we make more; too many, we start deleting. Balance β¨
Here's the plot twist though: if min_threads is 0 or larger than max_threads, then it is ignored and the pool will be set to run a static max_threads number of threads. fr fr, it just gets dropped and the pool runs a flat max_threads. no cap.
β οΈ Okay this part matters: the caller must ensure mutual exclusion between this and server startup or shutdown. Like, don't be doing this at the same time as startup/shutdown, that's not the vibe. Lock it down, bestie π
Returns zero on success or a negative errno if an error occurred while starting a thread. So 0 = slay, negative = something went sideways while spinning up a thread π
π SEE ALSO π
- Kernel file
./net/sunrpc/svc.c sunrpc_get_pool_mode(9)svc_serv_nrpools(9)svc_pool_for_cpu(9)svc_create(9)svc_create_pooled(9)svc_pool_wake_idle_thread(9)svc_new_thread(9)svc_set_num_threads(9)svc_serv_maxthreads(9)svc_rqst_replace_page(9)svc_rqst_release_pages(9)svc_exit_thread(9)svc_register(9)svc_stat_alloc_counts(9)svc_stat_free_counts(9)svc_process(9)svc_process_bc(9)svc_max_payload(9)svc_proc_name(9)svc_encode_result_payload(9)svc_fill_symlink_pathname(9)
and that's the whole page, bestie, you ate that ππ this one lives in ./net/sunrpc, dated October 2026, and it's filed under svc_set_pool_threads(9) β go forth and manage your pools responsibly π§ββοΈβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms