summaryrefslogtreecommitdiff
path: root/net/sunrpc/sched.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2021-07-12 16:57:08 +0300
committerTrond Myklebust <trond.myklebust@hammerspace.com>2021-10-04 03:49:05 +0300
commit47dd8796a31e132f9e2b93a4f558a9f924a7388f (patch)
tree299e8e5e98448e6872bf4ad6581b1e5bf08d5b1a /net/sunrpc/sched.c
parentea7a1019d8baf8503ecd6e3ec8436dec283569e6 (diff)
downloadlinux-47dd8796a31e132f9e2b93a4f558a9f924a7388f.tar.xz
SUNRPC: Add cond_resched() at the appropriate point in __rpc_execute()
Allow tasks that need to pre-empt rpciod/xprtiod to do so when it is safe. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net/sunrpc/sched.c')
-rw-r--r--net/sunrpc/sched.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index c045f63d11fa..dc46130d46a0 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -903,8 +903,10 @@ static void __rpc_execute(struct rpc_task *task)
/*
* Lockless check for whether task is sleeping or not.
*/
- if (!RPC_IS_QUEUED(task))
+ if (!RPC_IS_QUEUED(task)) {
+ cond_resched();
continue;
+ }
/*
* Signalled tasks should exit rather than sleep.