summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorOleksandr Natalenko <onatalen@redhat.com>2016-09-28 14:29:23 +0200
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-10-27 12:13:47 -0700
commitc7ee2362255cbc305728f1b116a3ad9b7a68a0e1 (patch)
tree4c4aacdc67b1b70c66798db1f6f3139b1c29a7b0 /configure.ac
parentc6a8a4739f45a4f877c561f72dd936d8f5741ae8 (diff)
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 <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > Reviewed-by: Niels de Vos <ndevos@redhat.com> > Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name> Change-Id: I1bc610586872d208430575c149a7d0c54bd82370 BUG: 1383692 Signed-off-by: Oleksandr Natalenko <onatalen@redhat.com> Reviewed-on: http://review.gluster.org/15622 Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac2
1 files changed, 2 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index b1cc0cc1c3c..8aa07ffbeb9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -495,6 +495,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