Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sunrpc: track the max number of requested threads in a pool

The kernel currently tracks the number of threads running in a pool in
the "sp_nrthreads" field. In the future, where threads are dynamically
spun up and down, it'll be necessary to keep track of the maximum number
of requested threads separately from the actual number running.

Add a pool->sp_nrthrmax parameter to track this. When userland changes
the number of threads in a pool, update that value accordingly.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

authored by

Jeff Layton and committed by
Chuck Lever
6cd60f42 2c01f0cf

+3 -1
+2 -1
include/linux/sunrpc/svc.h
··· 35 35 */ 36 36 struct svc_pool { 37 37 unsigned int sp_id; /* pool id; also node id on NUMA */ 38 + unsigned int sp_nrthreads; /* # of threads currently running in pool */ 39 + unsigned int sp_nrthrmax; /* Max requested number of threads in pool */ 38 40 struct lwq sp_xprts; /* pending transports */ 39 - unsigned int sp_nrthreads; /* # of threads in pool */ 40 41 struct list_head sp_all_threads; /* all server threads */ 41 42 struct llist_head sp_idle_threads; /* idle server threads */ 42 43
+1
net/sunrpc/svc.c
··· 839 839 if (!pool) 840 840 return -EINVAL; 841 841 842 + pool->sp_nrthrmax = nrservs; 842 843 delta -= pool->sp_nrthreads; 843 844 844 845 if (delta > 0)