Skip to contentSkip to conversation

Cleanups of the RPC waitqueue locking

PATCH New Trond Myklebust 1 participant 1 message Feb 26, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Cleanups of the RPC waitqueue locking

One of the main reasons for the complicated locking in the RPC waitqueue wakeup code is the fact that the timeout code can kick in at any time between the call to rpc_wake_up_*(), and the call to rpc_delete_timer() inside __rpc_execute().
By moving the timers from the rpc_task onto the waitqueue itself, we can greatly simplify the locking on the rpc_wakeup_task() stuff, since we can then guarantee that the timer will not touch the task once it has been removed from the wait queue (and the wake-queue loses track of where the task is).

Another simplification that results is that we can get rid of the rcu-safe releases of the RPC tasks.

Finally, we simplify the RPC timer callbacks themselves by moving the complexity into the process context (using task->tk_callback()), and simplify the RPC timer callbacks themselves to simply waking up the tasks and setting task->tk_status to ETIMEDOUT.

Cheers
Trond