]> 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)
commit9a18140cebb34ca4d2e76a3797d29d598889c0cf
treeb2078229902140dbe1ffa20383eb730a5e7ddef0
parentcd98d0e662f0365fa186408440b29d15dafc1bf2
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