es-que / cpuset

Automatically exported from code.google.com/p/cpuset
GNU General Public License v2.0
0 stars 0 forks source link

cset problem when cpuset already mounted #12

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. kernel-3.2.1
2. mount /sys/fs/cgroup
3. cset set -r

What is the expected output? 
should list default parent cpuset

What do you see instead?
mount: none already mounted or /sys/fs/cgroup/cpuset busy
cset: **> mount of cpuset filesystem failed, do you have permission?

What version of the product are you using? 
# cset -v
cset: Cpuset (cset) 1.5.6

On what operating system? Gentoo
# uname -a
Linux apps 3.2.1-gentoo-r2 #2 SMP Tue Feb 14 02:11:57 EST 2012 x86_64 AMD 
Opteron(tm) Processor 6128 AuthenticAMD GNU/Linux

Please provide any additional information below.

# zcat /proc/config.gz | egrep '(CGROUP|CPUSET)'
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CPUSETS=y
CONFIG_PROC_PID_CPUSET=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_MEM_RES_CTLR=y
CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y
CONFIG_CGROUP_MEM_RES_CTLR_SWAP_ENABLED=y
# CONFIG_CGROUP_PERF is not set
CONFIG_CGROUP_SCHED=y
# CONFIG_BLK_CGROUP is not set
CONFIG_NET_CLS_CGROUP=y

# grep cgroup /etc/fstab
cgroup /sys/fs/cgroup cgroup rw 0 0

When I mount /sys/fs/cgroup, 
kernel-3.2.1 automatically populates /sys/fs/cgroup
with the following directories:

cpu, cpuacct, cpuset, devices, freezer, memory, net_cls

When cset tries to mount cpuset, it discovers that it is already mounted.

Original issue reported on code.google.com by jer...@acjlaw.net on 21 Feb 2012 at 8:21

GoogleCodeExporter commented 8 years ago
# grep cgroup /proc/mounts 
cgroup /sys/fs/cgroup cgroup 
rw,relatime,net_cls,freezer,devices,memory,cpuacct,cpu,cpuset 0 0

Original comment by jer...@acjlaw.net on 21 Feb 2012 at 8:27

GoogleCodeExporter commented 8 years ago
cset.py is searching for cpuset path in /proc/mounts
but none is found because cpuset is option for mount

So cset.py tries to mount /sys/fs/cgroup/cpuset
but /sys/fs/cgroup/cpuset already exists

So need to handle kernel-3.2 behavior

Original comment by jer...@acjlaw.net on 21 Feb 2012 at 8:36