SUNRPC: Partial revert of commit 6f9f17287e78
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 12 Jul 2021 13:52:59 +0000 (09:52 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:17:20 +0000 (19:17 +0100)
commit3e1e7e4a6b54b9ed9a633a9faeb8f0dafd6dd7fb
tree3d611f273dfca875be050f1786fa4fca2179e604
parent7f837109586eb86d236f13cfdea7e23affd1636a
SUNRPC: Partial revert of commit 6f9f17287e78

commit ea7a1019d8baf8503ecd6e3ec8436dec283569e6 upstream.

The premise of commit 6f9f17287e78 ("SUNRPC: Mitigate cond_resched() in
xprt_transmit()") was that cond_resched() is expensive and unnecessary
when there has been just a single send.
The point of cond_resched() is to ensure that tasks that should pre-empt
this one get a chance to do so when it is safe to do so. The code prior
to commit 6f9f17287e78 failed to take into account that it was keeping a
rpc_task pinned for longer than it needed to, and so rather than doing a
full revert, let's just move the cond_resched.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sunrpc/xprt.c