diff options
| author | NeilBrown <neilb@suse.de> | 2023-09-11 10:39:04 -0400 |
|---|---|---|
| committer | Chuck Lever <chuck.lever@oracle.com> | 2023-10-16 12:44:04 -0400 |
| commit | fa341560ca7458f4396d5a0771cb5f2358d8535d (patch) | |
| tree | c8c18f267b8d7443da0e0dc581637b9c77353a9c /fs/lockd/svc.c | |
| parent | lockd: hold a reference to nlmsvc_serv while stopping the thread. (diff) | |
| download | linux-fa341560ca7458f4396d5a0771cb5f2358d8535d.tar.gz linux-fa341560ca7458f4396d5a0771cb5f2358d8535d.zip | |
SUNRPC: change how svc threads are asked to exit.
svc threads are currently stopped using kthread_stop(). This requires
identifying a specific thread. However we don't care which thread
stops, just as long as one does.
So instead, set a flag in the svc_pool to say that a thread needs to
die, and have each thread check this flag instead of calling
kthread_should_stop(). The first thread to find and clear this flag
then moves towards exiting.
This removes an explicit dependency on sp_all_threads which will make a
future patch simpler.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/lockd/svc.c')
| -rw-r--r-- | fs/lockd/svc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index 365cc7adff66..81be07c1d3d1 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c @@ -24,7 +24,6 @@ #include <linux/uio.h> #include <linux/smp.h> #include <linux/mutex.h> -#include <linux/kthread.h> #include <linux/freezer.h> #include <linux/inetdevice.h> @@ -135,11 +134,11 @@ lockd(void *vrqstp) * The main request loop. We don't terminate until the last * NFS mount or NFS daemon has gone away. */ - while (!kthread_should_stop()) { + while (!svc_thread_should_stop(rqstp)) { /* update sv_maxconn if it has changed */ rqstp->rq_server->sv_maxconn = nlm_max_connections; - nlmsvc_retry_blocked(); + nlmsvc_retry_blocked(rqstp); svc_recv(rqstp); } if (nlmsvc_ops) |
