]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sunrpc: introduce the concept of a minimum number of threads per pool
authorJeff Layton <jlayton@kernel.org>
Tue, 6 Jan 2026 18:59:46 +0000 (13:59 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Wed, 28 Jan 2026 15:15:42 +0000 (10:15 -0500)
commit7ffc7ade2cb1138ea5d4ab55cb42c878d44165fb
treec3465707433bd917b668a73cb3e59f55883a0e14
parent6cd60f4274b19327ebc5afa0c814b13379c34370
sunrpc: introduce the concept of a minimum number of threads per pool

Add a new pool->sp_nrthrmin field to track the minimum number of threads
in a pool. Add min_threads parameters to both svc_set_num_threads() and
svc_set_pool_threads(). If min_threads is non-zero and less than the
max, svc_set_num_threads() will ensure that the number of running
threads is between the min and the max.

If the min is 0 or greater than the max, then it is ignored, and the
maximum number of threads will be started, and never spun down.

For now, the min_threads is always 0, but a later patch will pass the
proper value through from nfsd.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/lockd/svc.c
fs/nfs/callback.c
fs/nfsd/nfssvc.c
include/linux/sunrpc/svc.h
net/sunrpc/svc.c