+AC_DEFUN([LIBCFS_HAVE_OOM_H],
+[LB_CHECK_FILE([$LINUX/include/linux/oom.h], [
+ AC_DEFINE(HAVE_LINUX_OOM_H, 1,
+ [kernel has include/oom.h])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
+#
+# check set_mems_allowed
+# 2.6.31 adds function set_mems_allowed in cpuset.h
+#
+AC_DEFUN([LIBCFS_HAVE_SET_MEMS_ALLOWED],
+[AC_MSG_CHECKING([whether have set_mems_allowed()])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/cpuset.h>
+],[
+ nodemask_t mask;
+
+ set_mems_allowed(mask);
+],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SET_MEMS_ALLOWED, 1, [have set_mems_allowed()])
+],[
+ AC_MSG_RESULT(NO)
+])
+])
+
+
+#
+# RHEL6/2.6.32 want to have pointer to shrinker self pointer in handler function
+#
+AC_DEFUN([LC_SHRINKER_WANT_SHRINK_PTR],
+[AC_MSG_CHECKING([shrinker want self pointer in handler])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/mm.h>
+],[
+ struct shrinker *tmp = NULL;
+ tmp->shrink(tmp, 0, 0);
+],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SHRINKER_WANT_SHRINK_PTR, 1,
+ [shrinker want self pointer in handler])
+],[
+ AC_MSG_RESULT(no)
+])
+])
+
+# 2.6.18 store oom parameters in task struct.
+# 2.6.32 store oom parameters in signal struct
+AC_DEFUN([LIBCFS_OOMADJ_IN_SIG],
+[AC_MSG_CHECKING([kernel store oom parameters in task])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/sched.h>
+],[
+ ((struct signal_struct *)0)->oom_adj = 0;
+],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_OOMADJ_IN_SIG, 1,
+ [kernel store a oom parameters in signal struct])
+],[
+ AC_MSG_RESULT(no)
+])
+])
+
+#
+# 2.6.33 no longer has ctl_name & strategy field in struct ctl_table.
+#
+AC_DEFUN([LIBCFS_SYSCTL_CTLNAME],
+[AC_MSG_CHECKING([if ctl_table has a ctl_name field])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/sysctl.h>
+],[
+ struct ctl_table ct;
+ ct.ctl_name = sizeof(ct);
+],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SYSCTL_CTLNAME, 1,
+ [ctl_table has ctl_name field])
+],[
+ AC_MSG_RESULT(no)
+])
+])
+