From: Chris Horn Date: Mon, 29 Jun 2015 18:15:23 +0000 (-0500) Subject: LU-6769 build: Test for kthread_worker support X-Git-Tag: 2.7.58~58 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F28%2F15428%2F6;p=fs%2Flustre-release.git LU-6769 build: Test for kthread_worker support 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 Change-Id: Ia89b73e4c8a3ad8549efdea70f0ebd96a1151dba Reviewed-on: http://review.whamcloud.com/15428 Tested-by: Jenkins Reviewed-by: Shuichi Ihara Reviewed-by: James Simmons Reviewed-by: Dmitry Eremin Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 2361415..926d4c9 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -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 + ],[ + 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])