From 83342145e6d757e34d91b423e728b7423a6c17a7 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Sat, 19 Aug 2023 18:17:58 +0800 Subject: [PATCH] SUNRPC: Add cond_resched() at the appropriate point in __rpc_execute() mainline inclusion from mainline-v5.16-rc1 commit 47dd8796a31e132f9e2b93a4f558a9f924a7388f category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I65HYE Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=47dd8796a31e132f9e2b93a4f558a9f924a7388f --------------------------- Allow tasks that need to pre-empt rpciod/xprtiod to do so when it is safe. Signed-off-by: Trond Myklebust Signed-off-by: Liu Jian --- net/sunrpc/sched.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index f0f55fbd1375..c939ecb25732 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c @@ -896,8 +896,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. -- Gitee