Whamcloud - gitweb
LU-10467 lustre: add wait_event macros suitable for upstream 62/35962/8
authorMr NeilBrown <neilb@suse.de>
Fri, 23 Aug 2019 06:02:22 +0000 (16:02 +1000)
committerOleg Drokin <green@whamcloud.com>
Mon, 30 Sep 2019 23:12:02 +0000 (23:12 +0000)
commitf6df31a163806c38c734add346ed7cbfe427cce4
tree4dbb8e396887bbfa4d996c249988924d1f1d21f6
parent40319db5bc649adaf3dad066e2c1bb49f7f1c04a
LU-10467 lustre: add wait_event macros suitable for upstream

This patch adds three sorts of wait_event macros.

1/ wait_event_idle_* which are available upstream, but not
   in older kernels.
   if TASK_NOLOAD is not available, we use TASK_UNINTERRUPTIBLE,
   and block all interrupts.

   We cannot use ___wait_cond_timeout() as it changed signature
   in 3.13. so we define our own ___wait_cond_timeout1().

2/ wait_event_idle_exclusive_lifo() and
   wait_event_idle_exclusive_lifo_timeout()
    which might be accepted upstream if we can make a strong case

   prepare_to_wait_event() doesn't support this directly, but
   as it won't relink a wait_entry that is already linked, it
   is sufficient to link to the head of the queue before calling
   prepare_to_wait_event().

3/ l_wait_event_abortable
   l_wait_event_abortable_timeout
   l_wait_event_abortable_exclusive
    which are unlikely to be accepted upstream, but match the general
    approach of upstream wait_event macros, and are useful
    to lustre.
    Possibly some or all of these should become wait_event_killable_*
    LUSTRE_FATAL_SIGS is moved over to linux-wait.h.

___wait_event() and related macros are copied from upstream linux,
and modified slightly to work across all supported kernels.

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.com>
Change-Id: I2d260fc159dbe5b1a3cc7a26e4aeedf30150d85a
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/35962
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/include/libcfs/linux/linux-wait.h
lustre/include/lustre_lib.h