Bug 1766425

Summary: cgroup control-cpu-load.sh script not working
Product: [Community] GlusterFS Reporter: Mohit Agrawal <moagrawa>
Component: coreAssignee: Mohit Agrawal <moagrawa>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6CC: bugs, nchilaka, pasik, rhinduja, rhs-bugs, storage-qa-internal
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1764208 Environment:
Last Closed: 2019-11-19 13:32:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1764202, 1764208    
Bug Blocks: 1766424    

Comment 1 Mohit Agrawal 2019-10-29 02:53:13 UTC
RCA:
  As per current code in script it moves the thread of any gluster process those have gluster keyword 
  as a substring and as of now all gluster threads has glfs prefix so script is not able to move all
  gluster threads to new created cgroup and cgroup restriction are not working

  if ps -T -p ${daemon_pid} | grep gluster > /dev/null; then
  for thid in `ps -T -p ${daemon_pid} | grep gluster | awk -F " " '{print $2}'`;
    do
      echo ${thid} > ${LOC}/${cgroup_name}/tasks ;
    done
  if cat /proc/${daemon_pid}/cgroup | grep -w ${cgroup_name} > /dev/null; then
    echo "Tasks are attached successfully specific to ${daemon_pid} to ${cgroup_name}."
  else
    echo "Tasks are not attached successfully."
  fi
fi
 
To avoid the same need to change the script for loop condition like below

if ps -T -p ${daemon_pid} | grep gluster > /dev/null; then
  for thid in `ps -T -p ${daemon_pid} | grep -v SPID | awk -F " " '{print $2}'`;
    do
      echo ${thid} > ${LOC}/${cgroup_name}/tasks ;
    done
  if cat /proc/${daemon_pid}/cgroup | grep -w ${cgroup_name} > /dev/null; then
    echo "Tasks are attached successfully specific to ${daemon_pid} to ${cgroup_name}."
  else
    echo "Tasks are not attached successfully."
  fi
fi

Comment 2 Worker Ant 2019-10-29 02:56:33 UTC
REVIEW: https://review.gluster.org/23635 (extras: Cgroup(CPU/Mem) restriction are not working on gluster process) posted (#1) for review on release-6 by MOHIT AGRAWAL

Comment 3 Worker Ant 2019-11-19 13:32:37 UTC
REVIEW: https://review.gluster.org/23635 (extras: Cgroup(CPU/Mem) restriction are not working on gluster process) merged (#2) on release-6 by hari gowtham