
From: Trond Myklebust <trond.myklebust@hammerspace.com> 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/?i... --------------------------- 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> Signed-off-by: Liu Jian <liujian56@huawei.com> --- 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. -- 2.34.1