summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svc.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2024-07-15 09:14:19 +0200
committerChuck Lever <chuck.lever@oracle.com>2024-09-21 01:31:03 +0200
commit9dcbc4e07087f750010c32b1c56fe1af8792a0ca (patch)
treefa916a94140c165614682537eec177aa35a02e6e /net/sunrpc/svc.c
parentsunrpc: change sp_nrthreads from atomic_t to unsigned int. (diff)
downloadlinux-9dcbc4e07087f750010c32b1c56fe1af8792a0ca.tar.xz
linux-9dcbc4e07087f750010c32b1c56fe1af8792a0ca.zip
sunrpc: don't take ->sv_lock when updating ->sv_nrthreads.
As documented in svc_xprt.c, sv_nrthreads is protected by the service mutex, and it does not need ->sv_lock. (->sv_lock is needed only for sv_permsocks, sv_tempsocks, and sv_tmpcnt). So remove the unnecessary locking. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to '')
-rw-r--r--net/sunrpc/svc.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 9442ebf38bbd..f30eeae56c44 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -721,10 +721,7 @@ svc_prepare_thread(struct svc_serv *serv, struct svc_pool *pool, int node)
if (!rqstp)
return ERR_PTR(-ENOMEM);
- spin_lock_bh(&serv->sv_lock);
serv->sv_nrthreads += 1;
- spin_unlock_bh(&serv->sv_lock);
-
pool->sp_nrthreads += 1;
/* Protected by whatever lock the service uses when calling
@@ -959,10 +956,7 @@ svc_exit_thread(struct svc_rqst *rqstp)
list_del_rcu(&rqstp->rq_all);
pool->sp_nrthreads -= 1;
-
- spin_lock_bh(&serv->sv_lock);
serv->sv_nrthreads -= 1;
- spin_unlock_bh(&serv->sv_lock);
svc_sock_update_bufs(serv);
svc_rqst_free(rqstp);