From 92f6ef8a63411eb80d4cc402b4285f87d745226f Mon Sep 17 00:00:00 2001 From: Oleksandr Natalenko Date: Wed, 28 Sep 2016 14:29:23 +0200 Subject: glusterfsd/main: fix OOM adjustment for older kernels Milind Changire reported that GlusterFS fails to build on RHEL5 because linux/oom.h is unavailable. Milind's initial patch disables OOM adjustment completely for those environments that do not have this header. However, I'd take another approach that: 1) checks for linux/oom.h in compile-time and defines necessary constants if the header is not present; 2) checks for available OOM API in /proc in run-time and uses it accordingly. This allows OOM to be adjusted properly on RHEL5 (the kernel is pretty new to present /proc API for that) as well as RHEL6 (the kernel has many thing backported including new /proc API). > Reviewed-on: http://review.gluster.org/15587 > Smoke: Gluster Build System > CentOS-regression: Gluster Build System > NetBSD-regression: NetBSD Build System > Reviewed-by: Niels de Vos > Tested-by: Oleksandr Natalenko Change-Id: I1bc610586872d208430575c149a7d0c54bd82370 BUG: 1383694 Signed-off-by: Oleksandr Natalenko Reviewed-on: http://review.gluster.org/15623 Tested-by: Oleksandr Natalenko Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Niels de Vos --- configure.ac | 2 ++ 1 file changed, 2 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 9025114030a..ac46911ab85 100644 --- a/configure.ac +++ b/configure.ac @@ -468,6 +468,8 @@ AC_SUBST(ZLIB_LIBS) AC_CHECK_HEADERS([linux/falloc.h]) +AC_CHECK_HEADERS([linux/oom.h], AC_DEFINE(HAVE_LINUX_OOM_H, 1, [have linux/oom.h])) + dnl Mac OS X does not have spinlocks AC_CHECK_FUNC([pthread_spin_init], [have_spinlock=yes]) if test "x${have_spinlock}" = "xyes"; then -- cgit