Commit 83342145 authored by Trond Myklebust's avatar Trond Myklebust Committed by Liu Jian
Browse files

SUNRPC: Add cond_resched() at the appropriate point in __rpc_execute()

mainline inclusion
from mainline-v5.16-rc1
commit 47dd8796
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: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarLiu Jian <liujian56@huawei.com>
parent de22a0cb
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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.