Revision 94b3dd0f7bb393d93e84a173b1df9b8b64c83ac4 authored by Greg Thelen on 04 June 2010, 21:15:03 UTC, committed by Linus Torvalds on 04 June 2010, 22:21:45 UTC
Child groups should have a greater depth than their parents. Prior to this change, the parent would incorrectly report zero memory usage for child cgroups when use_hierarchy is enabled. test script: mount -t cgroup none /cgroups -o memory cd /cgroups mkdir cg1 echo 1 > cg1/memory.use_hierarchy mkdir cg1/cg11 echo $$ > cg1/cg11/tasks dd if=/dev/zero of=/tmp/foo bs=1M count=1 echo echo CHILD grep cache cg1/cg11/memory.stat echo echo PARENT grep cache cg1/memory.stat echo $$ > tasks rmdir cg1/cg11 cg1 cd / umount /cgroups Using fae9c79, a recent patch that changed alloc_css_id() depth computation, the parent incorrectly reports zero usage: root@ubuntu:~# ./test 1+0 records in 1+0 records out 1048576 bytes (1.0 MB) copied, 0.0151844 s, 69.1 MB/s CHILD cache 1048576 total_cache 1048576 PARENT cache 0 total_cache 0 With this patch, the parent correctly includes child usage: root@ubuntu:~# ./test 1+0 records in 1+0 records out 1048576 bytes (1.0 MB) copied, 0.0136827 s, 76.6 MB/s CHILD cache 1052672 total_cache 1052672 PARENT cache 0 total_cache 1052672 Signed-off-by: Greg Thelen <gthelen@google.com> Acked-by: Paul Menage <menage@google.com> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: Li Zefan <lizf@cn.fujitsu.com> Cc: <stable@kernel.org> [2.6.34.x] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 007d086
File | Mode | Size |
---|---|---|
Kconfig | -rw-r--r-- | 2.8 KB |
Makefile | -rw-r--r-- | 711 bytes |
array.c | -rw-r--r-- | 13.3 KB |
base.c | -rw-r--r-- | 76.0 KB |
cmdline.c | -rw-r--r-- | 651 bytes |
cpuinfo.c | -rw-r--r-- | 564 bytes |
devices.c | -rw-r--r-- | 1.4 KB |
generic.c | -rw-r--r-- | 19.5 KB |
inode.c | -rw-r--r-- | 11.8 KB |
internal.h | -rw-r--r-- | 3.8 KB |
interrupts.c | -rw-r--r-- | 1.1 KB |
kcore.c | -rw-r--r-- | 15.2 KB |
kmsg.c | -rw-r--r-- | 1.5 KB |
loadavg.c | -rw-r--r-- | 1.1 KB |
meminfo.c | -rw-r--r-- | 4.5 KB |
mmu.c | -rw-r--r-- | 1.4 KB |
nommu.c | -rw-r--r-- | 3.3 KB |
page.c | -rw-r--r-- | 4.8 KB |
proc_devtree.c | -rw-r--r-- | 5.2 KB |
proc_net.c | -rw-r--r-- | 4.6 KB |
proc_sysctl.c | -rw-r--r-- | 9.5 KB |
proc_tty.c | -rw-r--r-- | 4.7 KB |
root.c | -rw-r--r-- | 4.7 KB |
softirqs.c | -rw-r--r-- | 994 bytes |
stat.c | -rw-r--r-- | 5.0 KB |
task_mmu.c | -rw-r--r-- | 20.3 KB |
task_nommu.c | -rw-r--r-- | 5.7 KB |
uptime.c | -rw-r--r-- | 1.2 KB |
version.c | -rw-r--r-- | 761 bytes |
vmcore.c | -rw-r--r-- | 16.1 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...