summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorOleksandr Natalenko <onatalen@redhat.com>2016-09-28 14:29:23 +0200
committerNiels de Vos <ndevos@redhat.com>2016-10-12 04:01:28 -0700
commit92f6ef8a63411eb80d4cc402b4285f87d745226f (patch)
tree8b9824420150f8dee8bb874f9dfd039e618d5ccb /libglusterfs
parentad9a1d1e8430388995f6a3fcd192ada7c9417a8d (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: 1383694 Signed-off-by: Oleksandr Natalenko <onatalen@redhat.com> Reviewed-on: http://review.gluster.org/15623 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 'libglusterfs')
-rw-r--r--libglusterfs/src/glusterfs.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h
index 0cee2ba3868..6e2d370605b 100644
--- a/libglusterfs/src/glusterfs.h
+++ b/libglusterfs/src/glusterfs.h
@@ -345,7 +345,6 @@ struct _cmd_args {
int acl;
int selinux;
int capability;
- char *oom_score_adj;
int enable_ino32;
int worm;
int mac_compat;
@@ -391,6 +390,11 @@ struct _cmd_args {
/* Should management connections use SSL? */
int secure_mgmt;
+
+ /* Linux-only OOM killer adjustment */
+#ifdef GF_LINUX_HOST_OS
+ char *oom_score_adj;
+#endif
};
typedef struct _cmd_args cmd_args_t;