summaryrefslogtreecommitdiffstats
path: root/fs/lockd
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2023-07-18 08:38:08 +0200
committerChuck Lever <chuck.lever@oracle.com>2023-08-29 23:45:22 +0200
commitc743b4259c3af2c0637c307f08a062d25fa3c99f (patch)
treed279633fbce7641d6711b2788d8e3c8705ea99cc /fs/lockd
parentSUNRPC: change svc_recv() to return void. (diff)
downloadlinux-c743b4259c3af2c0637c307f08a062d25fa3c99f.tar.xz
linux-c743b4259c3af2c0637c307f08a062d25fa3c99f.zip
SUNRPC: remove timeout arg from svc_recv()
Most svc threads have no interest in a timeout. nfsd sets it to 1 hour, but this is a wart of no significance. lockd uses the timeout so that it can call nlmsvc_retry_blocked(). It also sometimes calls svc_wake_up() to ensure this is called. So change lockd to be consistent and always use svc_wake_up() to trigger nlmsvc_retry_blocked() - using a timer instead of a timeout to svc_recv(). And change svc_recv() to not take a timeout arg. This makes the sp_threads_timedout counter always zero. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/lockd')
-rw-r--r--fs/lockd/svc.c14
-rw-r--r--fs/lockd/svclock.c5
2 files changed, 12 insertions, 7 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index cf4ff7d3564c..ef3f77a59556 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -56,6 +56,12 @@ static unsigned int nlmsvc_users;
static struct svc_serv *nlmsvc_serv;
unsigned long nlmsvc_timeout;
+static void nlmsvc_request_retry(struct timer_list *tl)
+{
+ svc_wake_up(nlmsvc_serv);
+}
+DEFINE_TIMER(nlmsvc_retry, nlmsvc_request_retry);
+
unsigned int lockd_net_id;
/*
@@ -130,14 +136,11 @@ lockd(void *vrqstp)
* NFS mount or NFS daemon has gone away.
*/
while (!kthread_should_stop()) {
- long timeout = MAX_SCHEDULE_TIMEOUT;
-
/* update sv_maxconn if it has changed */
rqstp->rq_server->sv_maxconn = nlm_max_connections;
- timeout = nlmsvc_retry_blocked();
-
- svc_recv(rqstp, timeout);
+ nlmsvc_retry_blocked();
+ svc_recv(rqstp);
}
if (nlmsvc_ops)
nlmsvc_invalidate_all();
@@ -371,6 +374,7 @@ static void lockd_put(void)
#endif
svc_set_num_threads(nlmsvc_serv, NULL, 0);
+ timer_delete_sync(&nlmsvc_retry);
nlmsvc_serv = NULL;
dprintk("lockd_down: service destroyed\n");
}
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index 28abec5c451d..43aeba9de55c 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -1019,7 +1019,7 @@ retry_deferred_block(struct nlm_block *block)
* picks up locks that can be granted, or grant notifications that must
* be retransmitted.
*/
-unsigned long
+void
nlmsvc_retry_blocked(void)
{
unsigned long timeout = MAX_SCHEDULE_TIMEOUT;
@@ -1049,5 +1049,6 @@ nlmsvc_retry_blocked(void)
}
spin_unlock(&nlm_blocked_lock);
- return timeout;
+ if (timeout < MAX_SCHEDULE_TIMEOUT)
+ mod_timer(&nlmsvc_retry, jiffies + timeout);
}