Whamcloud - gitweb
LU-10467 ptlrpc: convert waiters on set->set_waitq
There are a couple of interesting aspects of waiters on ->set_waitq.
One is the only usage of LWI_TIMEOUT_INTR_ALL(). This causes
l_wait_event() to enable "fatal" signals during the timeout
part of the wait. (normally signals are completely blocked when
there is a timeout).
This can be converted to l_wait_event_abortable_timeout().
Another is that ptlrpc_expired_set() is passed as the on_timeout
handler. As this always returns true, it cauess l_wait_event()
to quit after the timeout, and not go "back to sleep".
We can instead call this explicitly after the wait_event_timeout
returns 0 - which means that it timedout.
Due to this change in call pattern, we can change the function to
take a ptlrpc_request_set* instead of a void*, and to not return
anything.
Also, ptlrpc_interrupted_set() is sometimes passed as the on_signal
function. Instead we can explicitly call this when we get a negative
return from wait_event_abortable. Again, we can declare it as
taking the real type and not a void*.
The wait on set_waitq in ptlrpcd() might be a timedout wait or,
if timeout == 0, it is an indefinite wait. We make that explicit
with 2 separate cases.
So this patch:
- changes to wait_event_idle_timeout and
l_wait_event_abortable_timeout,
- calls ptlrpc_*_set explicitly based on return code
- changes signatures for ptlrpc_*_set()
Change-Id: Ieb97aa3ba9b1f988a30bb7a424588f87f75e8023
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/35982
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>