diff options
author | NeilBrown <[email protected]> | 2023-07-31 16:48:28 +1000 |
---|---|---|
committer | Chuck Lever <[email protected]> | 2023-08-29 17:45:22 -0400 |
commit | 6859d1f2902c600f6b1c587c91408a91e05cdc02 (patch) | |
tree | e2930bdc74c22147444e9bcf843f3ac9e375398e /Documentation/filesystems/caching/backend-api.rst | |
parent | d2f0ef1cbf37e396ef9c57a30c004ebe65cdbca9 (diff) |
SUNRPC: make rqst_should_sleep() idempotent()
Based on its name you would think that rqst_should_sleep() would be
read-only, not changing anything. But in fact it will clear
SP_TASK_PENDING if that was set. This is surprising, and it blurs the
line between "check for work to do" and "dequeue work to do".
So change the "test_and_clear" to simple "test" and clear the bit once
the thread has decided to wake up and return to the caller.
With this, it makes sense to *always* set SP_TASK_PENDING when asked,
rather than to set it only if no thread could be woken up.
[ cel: Previously TASK_PENDING indicated there is work waiting but no
idle threads were found to pick up that work. After this patch, it acts
as an XPT_BUSY flag for wake-ups that have no associated xprt. ]
Signed-off-by: NeilBrown <[email protected]>
Reviewed-by: Jeff Layton <[email protected]>
Signed-off-by: Chuck Lever <[email protected]>
Diffstat (limited to 'Documentation/filesystems/caching/backend-api.rst')
0 files changed, 0 insertions, 0 deletions