I have following cgroups configuration: hosting /mnt/cgroup cgroup memory,cpu,cpuacct,blkio 0 0 It already mounted: mount | grep cgr hosting on /mnt/cgroup type cgroup (rw,memory,cpu,cpuacct,blkio) And consist following groups: ls -l /mnt/cgroup/ total 0 -r--r--r-- 1 root root 0 2010-05-16 02:19 blkio.sectors -r--r--r-- 1 root root 0 2010-05-16 02:19 blkio.time -rw-r--r-- 1 root root 0 2010-05-16 02:19 blkio.weight -r--r--r-- 1 root root 0 2010-05-16 02:19 cgroup.procs -r--r--r-- 1 root root 0 2010-05-16 02:19 cpuacct.stat -rw-r--r-- 1 root root 0 2010-05-16 02:19 cpuacct.usage -r--r--r-- 1 root root 0 2010-05-16 02:19 cpuacct.usage_percpu -rw-r--r-- 1 root root 0 2010-05-16 02:19 cpu.shares -rw-r--r-- 1 root root 0 2010-05-16 02:19 memory.failcnt --w------- 1 root root 0 2010-05-16 02:19 memory.force_empty -rw-r--r-- 1 root root 0 2010-05-16 02:19 memory.limit_in_bytes -rw-r--r-- 1 root root 0 2010-05-16 02:19 memory.max_usage_in_bytes -rw-r--r-- 1 root root 0 2010-05-16 02:19 memory.memsw.failcnt -rw-r--r-- 1 root root 0 2010-05-16 02:19 memory.memsw.limit_in_bytes -rw-r--r-- 1 root root 0 2010-05-16 02:19 memory.memsw.max_usage_in_bytes -r--r--r-- 1 root root 0 2010-05-16 02:19 memory.memsw.usage_in_bytes -rw-r--r-- 1 root root 0 2010-05-16 02:19 memory.soft_limit_in_bytes -r--r--r-- 1 root root 0 2010-05-16 02:19 memory.stat -rw-r--r-- 1 root root 0 2010-05-16 02:19 memory.swappiness -r--r--r-- 1 root root 0 2010-05-16 02:19 memory.usage_in_bytes -rw-r--r-- 1 root root 0 2010-05-16 02:19 memory.use_hierarchy -rw-r--r-- 1 root root 0 2010-05-16 02:19 notify_on_release -rw-r--r-- 1 root root 0 2010-05-16 02:19 release_agent -rw-r--r-- 1 root root 0 2010-05-16 02:19 tasks drwxr-xr-x 2 root root 0 2010-05-16 02:19 v001001 drwxr-xr-x 2 root root 0 2010-05-16 02:19 v001002 drwxr-xr-x 2 root root 0 2010-05-16 02:19 v001003 But when I try create new subcgroup in our cgroup /mnt/cgroup/v001001, i get error: cd /mnt/cgroup/v001001/; mkdir subcgroup mkdir: cannot create directory `subcgroup': Invalid argument But in Documentation/cgroups/cgroups.txt: You can also create cgroups inside your cgroup by using mkdir in this directory. # mkdir my_sub_cs Its bug?
I experience the same issue. It seems to be related to the blkio subsystem. If I mount only with "-o cpu", everything works as expected. I haven't tried the other subsystems, though. I'm using a 2.6.34 kernel.
The reason seems to be this: http://lwn.net/Articles/413015/ Basically, memory and blkio subsystems do not support hierarchies. Therefore they disallow their creation. The proposed patch (which will be included into 2.6.38 according to this: http://thread.gmane.org/gmane.linux.kernel/1057268) will support hierarchies but basically transforms them back into a flat hierarchy. That should solve all issues described in this ticket.