Whamcloud - gitweb
LU-12930 various: use schedule_timeout_*interruptible 56/36656/6
authorMr NeilBrown <neilb@suse.de>
Mon, 4 Nov 2019 01:05:32 +0000 (12:05 +1100)
committerOleg Drokin <green@whamcloud.com>
Fri, 14 Feb 2020 05:50:24 +0000 (05:50 +0000)
commit5c883ea2748ae9e430a9cd863a9b630b2a74440a
tree37ac384b0e48e636284ec85f0d931e7f786ada1b
parentf2d06d3c76a1d69447e7bd6fd29d8165be558d73
LU-12930 various: use schedule_timeout_*interruptible

The construct:

  set_current_state(TASK_UNINTERRUPTIBLE);
  schedule_timeout(time);

Is more clearly expressed as

  schedule_timeout_uninterruptible(time);

And similarly with TASK_INTERRUPTIBLE /
schedule_timeout_interruptible()

Establishing this practice makes it harder to forget to call
set_current_state() as has happened a couple of times - in
lnet_peer_discovery and mdd_changelog_fini().

Also, there is no need to set_current_state(TASK_RUNNABLE) after
calling schedule*().  That state is guaranteed to have been set.

In mdd_changelog_fini() there was an attempt to sleep for
10 microseconds.  This will always round up to 1 jiffy, so
just make it schedule_timeout_uninterruptible(1).

Finally a few places where the number of seconds was multiplied
by 1, have had the '1 *' removed.

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I01b37039de0bf7e07480de372c1a4cfe78a8cdd8
Reviewed-on: https://review.whamcloud.com/36656
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
36 files changed:
libcfs/libcfs/fail.c
libcfs/libcfs/tracefile.c
libcfs/libcfs/workitem.c
lnet/klnds/gnilnd/gnilnd.c
lnet/klnds/gnilnd/gnilnd_stack.c
lnet/klnds/gnilnd/gnilnd_sysctl.c
lnet/klnds/o2iblnd/o2iblnd.c
lnet/klnds/o2iblnd/o2iblnd_cb.c
lnet/klnds/socklnd/socklnd.c
lnet/klnds/socklnd/socklnd_cb.c
lnet/lnet/acceptor.c
lnet/lnet/api-ni.c
lnet/lnet/peer.c
lnet/lnet/router.c
lnet/selftest/conrpc.c
lnet/selftest/rpc.c
lnet/selftest/selftest.h
lustre/ldlm/ldlm_lib.c
lustre/ldlm/ldlm_lockd.c
lustre/ldlm/ldlm_resource.c
lustre/lfsck/lfsck_lib.c
lustre/llite/llite_lib.c
lustre/lov/lov_io.c
lustre/mdc/mdc_changelog.c
lustre/mdd/mdd_device.c
lustre/mdt/mdt_handler.c
lustre/obdclass/genops.c
lustre/obdclass/obd_mount_server.c
lustre/obdecho/echo_client.c
lustre/osp/osp_internal.h
lustre/osp/osp_sync.c
lustre/ptlrpc/gss/gss_svc_upcall.c
lustre/ptlrpc/sec.c
lustre/quota/lquota_entry.c
lustre/quota/qsd_handler.c
lustre/quota/qsd_lib.c