]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitd2ae4e0c292975c01309cdf0e1f22770a25268b2
treeb2078229902140dbe1ffa20383eb730a5e7ddef0
parent93350d0c13e30f42046a5cbc2aabc2d45f3b1b08
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