-1

creating a question from the forums so i can answer it here and leave for others as it took me ages to debug this one

hi,

i would like to test the following: the process bzip2 for user testuser goes into the group cpuhungry the group is only allowed to use core 1, not core 0.

/etc/cgrules.conf

testuser:bzip2   cpuset   cpuhungry/;

/etc/cgconfig.conf

mount {
  cpuset = /mnt/cgroups/cpuset;
}

group cpuhungry {
  cpuset {
      cpuset.cpus = 1
  }
}

ive tried the init skript some times, but i guess it is broken. looks like you need to run

cgconfigparser -l /etc/cgconfig.conf to setup the mounts in the first place, the init script misses this step.

starting the daemon via: sudo cgrulesengd -d results in:

CGroup Rules Engine Daemon log started
Current time: Fri Jul 29 11:32:53 2011

Opened log file: -, log facility: 0, log level: 7
Proceeding with PID 9527
Rule: testuser:bzip2
  UID: 1000
  GID: N/A
  DEST: cpuhungry/
  CONTROLLERS:
    cpuset

Started the CGroup Rules Engine Daemon.
.
.
.
Cgroup change for PID: 9528, UID: 1000, GID: 1000, PROCNAME: /bin/bzip2 FAILED! (Error Code: 50016)
GID Event: PID = 1950, tGID = 1950, rGID = 0, eGID = 122

the error code 50016 is of course not documented nor does something pop up in a google search.

any ideas how to fix this?

balder
  • 101
  • 2

1 Answers1

0

This error is caused because the cpuset.mems resources is not populated to fix this simply populate it with one of the following

run

echo 0 > /sys/fs/cgroup/cpuset/cpuhungry/cpuset.mems

or

cgset -r cpuset.mems=0 cpuhungry

or update /etc/cgconfig.conf

mount {
  cpuset = /mnt/cgroups/cpuset;
}

group cpuhungry {
  cpuset {
      cpuset.cpus = 1
      cpuset.mems = 0
  }
}

also see here

balder
  • 101
  • 2