17b94a
From 23091d24d34102c7938ae2890930b73c89c5a8e7 Mon Sep 17 00:00:00 2001
17b94a
From: Mohit Agrawal <moagrawal@redhat.com>
17b94a
Date: Tue, 22 Oct 2019 18:52:25 +0530
17b94a
Subject: [PATCH 313/313] extras: Cgroup(CPU/Mem) restriction are not working
17b94a
 on gluster process
17b94a
17b94a
Problem: After Configure the Cgroup(CPU/MEM) limit to a gluster processes
17b94a
         resource(CPU/MEM) limits are not applicable to the gluster
17b94a
         processes.Cgroup limits are not applicable because all threads are
17b94a
         not moved into a newly created cgroup to apply restriction.
17b94a
17b94a
Solution: To move a gluster thread to newly created cgroup change the
17b94a
          condition in script
17b94a
17b94a
> Change-Id: I8ad81c69200e4ec43a74f6052481551cf835354c
17b94a
> Fixes: bz#1764208
17b94a
> (Cherry pick from commit 38de02012948013a88597545cf49380ce97f6fa7)
17b94a
> (Reviewed on upstream link https://review.gluster.org/#/c/glusterfs/+/23599/)
17b94a
> Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
17b94a
17b94a
Change-Id: I8ad81c69200e4ec43a74f6052481551cf835354c
17b94a
BUG: 1764202
17b94a
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
17b94a
Reviewed-on: https://code.engineering.redhat.com/gerrit/183730
17b94a
Tested-by: RHGS Build Bot <nigelb@redhat.com>
17b94a
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
17b94a
---
17b94a
 extras/control-cpu-load.sh | 2 +-
17b94a
 extras/control-mem.sh      | 2 +-
17b94a
 2 files changed, 2 insertions(+), 2 deletions(-)
17b94a
17b94a
diff --git a/extras/control-cpu-load.sh b/extras/control-cpu-load.sh
17b94a
index b739c82..52dcf62 100755
17b94a
--- a/extras/control-cpu-load.sh
17b94a
+++ b/extras/control-cpu-load.sh
17b94a
@@ -104,7 +104,7 @@ echo "Setting $quota_value to cpu.cfs_quota_us for gluster_cgroup."
17b94a
 echo ${quota_value} > ${LOC}/${cgroup_name}/cpu.cfs_quota_us
17b94a
 
17b94a
 if ps -T -p ${daemon_pid} | grep gluster > /dev/null; then
17b94a
-  for thid in `ps -T -p ${daemon_pid} | grep gluster | awk -F " " '{print $2}'`;
17b94a
+  for thid in `ps -T -p ${daemon_pid} | grep -v SPID | awk -F " " '{print $2}'`;
17b94a
     do
17b94a
       echo ${thid} > ${LOC}/${cgroup_name}/tasks ;
17b94a
     done
17b94a
diff --git a/extras/control-mem.sh b/extras/control-mem.sh
17b94a
index 38aa2a0..91b36f8 100755
17b94a
--- a/extras/control-mem.sh
17b94a
+++ b/extras/control-mem.sh
17b94a
@@ -116,7 +116,7 @@ else
17b94a
 fi
17b94a
 
17b94a
 if ps -T -p ${daemon_pid} | grep gluster > /dev/null; then
17b94a
-  for thid in `ps -T -p ${daemon_pid} | grep gluster | awk -F " " '{print $2}'`;
17b94a
+  for thid in `ps -T -p ${daemon_pid} | grep -v SPID | awk -F " " '{print $2}'`;
17b94a
     do
17b94a
       echo ${thid} > ${LOC}/${cgroup_name}/tasks ;
17b94a
     done
17b94a
-- 
17b94a
1.8.3.1
17b94a