summaryrefslogtreecommitdiff
path: root/include/linux/sunrpc/svc.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2023-09-11 10:40:09 -0400
committerChuck Lever <chuck.lever@oracle.com>2023-10-16 12:44:07 -0400
commit2e8fc923fe476db8cab9b6458027eccb22f3b6e6 (patch)
tree5b143877a907eb433062042d60d09f469b2a9728 /include/linux/sunrpc/svc.h
parent9a0e6accc0a8c3adf72f1b43be8019961b68663a (diff)
SUNRPC: change sp_nrthreads to atomic_t
Using an atomic_t avoids the need to take a spinlock (which can soon be removed). Choosing a thread to kill needs to be careful as we cannot set the "die now" bit atomically with the test on the count. Instead we temporarily increase the count. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'include/linux/sunrpc/svc.h')
-rw-r--r--include/linux/sunrpc/svc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 7ff9fe785e49..9d0fcd6148ae 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -36,7 +36,7 @@ struct svc_pool {
unsigned int sp_id; /* pool id; also node id on NUMA */
spinlock_t sp_lock; /* protects all fields */
struct lwq sp_xprts; /* pending transports */
- unsigned int sp_nrthreads; /* # of threads in pool */
+ atomic_t sp_nrthreads; /* # of threads in pool */
struct list_head sp_all_threads; /* all server threads */
struct llist_head sp_idle_threads; /* idle server threads */