Whamcloud - gitweb
LU-6769 build: Test for kthread_worker support 28/15428/6
authorChris Horn <hornc@cray.com>
Mon, 29 Jun 2015 18:15:23 +0000 (13:15 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 29 Jul 2015 15:39:22 +0000 (15:39 +0000)
The OFED compatibility layer will backport kthread_worker unless
CONFIG_COMPAT_IS_KTHREAD is defined. kthread_worker is available in
the SLES 11 SP3 kernel, but not RHEL 6.5 or RHEL 6.6. This mod adds a
test to check if kthread is available in the kernel and defines
CONFIG_COMPAT_IS_KTHREAD appropriately.

Later versions of MLNX_OFED (2.4, 3.0) require that we similarly
define HAVE_KTHREAD_WORK.

Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: Ia89b73e4c8a3ad8549efdea70f0ebd96a1151dba
Reviewed-on: http://review.whamcloud.com/15428
Tested-by: Jenkins
Reviewed-by: Shuichi Ihara <sihara@ddn.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lnet/autoconf/lustre-lnet.m4

index 2361415..926d4c9 100644 (file)
@@ -254,6 +254,18 @@ directory which is likely in ${O2IBPATH%-*}
                                EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_SLES_11_$SP"
                        fi
                fi
+
+               LB_CHECK_COMPILE([if Linux kernel has kthread_worker],
+               linux_kthread_worker, [
+                       #include <linux/kthread.h>
+               ],[
+                       struct kthread_work     *kth_wrk __attribute__ ((unused));
+                       flush_kthread_work(kth_wrk);
+               ],[
+                       EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_IS_KTHREAD"
+                       AC_DEFINE(HAVE_KTHREAD_WORK, 1, [kthread_worker found])
+               ])
+
                AC_MSG_CHECKING([whether to use any OFED backport headers])
                if test -n "$BACKPORT_INCLUDES"; then
                        AC_MSG_RESULT([yes])