Whamcloud - gitweb
LU-10467 lustre: don't use l_wait_event() for simple sleep. 66/35966/6
authorMr NeilBrown <neilb@suse.com>
Wed, 2 Oct 2019 02:19:01 +0000 (12:19 +1000)
committerOleg Drokin <green@whamcloud.com>
Fri, 6 Dec 2019 00:57:56 +0000 (00:57 +0000)
commit077b35568be57f02c389b31553e17d5247d76897
treec195aa3c2c80c1a1d747a2bab4a763f2a8f5229c
parent451a2634a967a4784340ba1c47182e0bdb4d56e1
LU-10467 lustre: don't use l_wait_event() for simple sleep.

Passing '0' as the condition to l_wait_event() means that
it just waits for the given timeout.
This can be done more simply with ssleep(seconds) or in
one case, a schedule_timeout_killable() loop.

In most of these case, l_wait_event() in configured to ignore signals,
so ssleep() - which also ignores signals - is appropriate.
In one case (lfsck_lib.c) l_wait_event() is configured to respond
to fatal signals, and as there is no ssleep_killable, we
need to opencode one.

ssleep() and schedule_timeout_killable() *will* add to the load
average, while l_wait_event() does not, so if these sleeps happen a
lot, it will add to the load average.  I don't think that will be a
problem for these sleeps.

So remove these l_wait_event() calls and associated variables,
and do it the simpler ways.

Signed-off-by: Mr NeilBrown <neilb@suse.com>
Change-Id: I5a77e631c68f6dfb45fdd7ea01d60b13268240cc
Reviewed-on: https://review.whamcloud.com/35966
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Reviewed-by: Petros Koutoupis <pkoutoupis@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/fid/fid_request.c
lustre/lfsck/lfsck_lib.c
lustre/mdc/mdc_request.c
lustre/ptlrpc/events.c
lustre/target/tgt_handler.c