summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2023-09-11 17:39:30 +0300
committerChuck Lever <chuck.lever@oracle.com>2023-10-16 19:44:05 +0300
commit9bd4161c591710f152a8cd3ed85ea928c61e26ca (patch)
tree28f92ebc977aff7156a9470489c60672c5142df9 /lib
parentd6b3358a2813bb14791259a2227d9af1e7019ca0 (diff)
downloadlinux-9bd4161c591710f152a8cd3ed85ea928c61e26ca.tar.xz
SUNRPC: change service idle list to be an llist
With an llist we don't need to take a lock to add a thread to the list, though we still need a lock to remove it. That will go in the next patch. Unlike double-linked lists, a thread cannot reliably remove itself from the list. Only the first thread can be removed, and that can change asynchronously. So some care is needed. We already check if there is pending work to do, so we are unlikely to add ourselves to the idle list and then want to remove ourselves again. If we DO find something needs to be done after adding ourselves to the list, we simply wake up the first thread on the list. If that was us, we successfully removed ourselves and can continue. If it was some other thread, they will do the work that needs to be done. We can safely sleep until woken. We also remove the test on freezing() from rqst_should_sleep(). Instead we set TASK_FREEZABLE before scheduling. This makes is safe to schedule() when a freeze is pending. As we now loop waiting to be removed from the idle queue, this is a cleaner way to handle freezing. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions