SUNRPC: use sv_lock to protect updates to sv_nrthreads.
authorNeilBrown <neilb@suse.de>
Mon, 29 Nov 2021 04:51:25 +0000 (15:51 +1100)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 13 Dec 2021 18:42:52 +0000 (13:42 -0500)
commit2a36395fac3b72771f87c3ee4387e3a96d85a7cc
treeb2078229902140dbe1ffa20383eb730a5e7ddef0
parent9b6c8c9bebccd5fb785c306b948c08874a88874d
SUNRPC: use sv_lock to protect updates to sv_nrthreads.

Using sv_lock means we don't need to hold the service mutex over these
updates.

In particular,  svc_exit_thread() no longer requires synchronisation, so
threads can exit asynchronously.

Note that we could use an atomic_t, but as there are many more read
sites than writes, that would add unnecessary noise to the code.
Some reads are already racy, and there is no need for them to not be.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfssvc.c
net/sunrpc/svc.c