aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBalbir Singh <balbir@linux.vnet.ibm.com>2009-01-07 21:08:03 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-08 11:31:05 -0500
commit52bc0d82100cd896213a9a25ec01c1ba87b939db (patch)
tree9d697d032c9374e2d14639ca8ef48577d020d573
parentf8d665422603ee1b8ed04dcad4242f14d623c941 (diff)
memcg: memory cgroup hierarchy documentation
Documentation updates for hierarchy support Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Cc: Paul Menage <menage@google.com> Cc: Li Zefan <lizf@cn.fujitsu.com> Cc: David Rientjes <rientjes@google.com> Cc: Pavel Emelianov <xemul@openvz.org> Cc: Dhaval Giani <dhaval@linux.vnet.ibm.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--Documentation/controllers/memory.txt38
1 files changed, 37 insertions, 1 deletions
diff --git a/Documentation/controllers/memory.txt b/Documentation/controllers/memory.txt
index 05fe29ab1e58..09e1c737d285 100644
--- a/Documentation/controllers/memory.txt
+++ b/Documentation/controllers/memory.txt
@@ -289,8 +289,44 @@ will be charged as a new owner of it.
289 Because rmdir() moves all pages to parent, some out-of-use page caches can be 289 Because rmdir() moves all pages to parent, some out-of-use page caches can be
290 moved to the parent. If you want to avoid that, force_empty will be useful. 290 moved to the parent. If you want to avoid that, force_empty will be useful.
291 291
2926. Hierarchy support
292 293
2936. TODO 294The memory controller supports a deep hierarchy and hierarchical accounting.
295The hierarchy is created by creating the appropriate cgroups in the
296cgroup filesystem. Consider for example, the following cgroup filesystem
297hierarchy
298
299 root
300 / | \
301 / | \
302 a b c
303 | \
304 | \
305 d e
306
307In the diagram above, with hierarchical accounting enabled, all memory
308usage of e, is accounted to its ancestors up until the root (i.e, c and root),
309that has memory.use_hierarchy enabled. If one of the ancestors goes over its
310limit, the reclaim algorithm reclaims from the tasks in the ancestor and the
311children of the ancestor.
312
3136.1 Enabling hierarchical accounting and reclaim
314
315The memory controller by default disables the hierarchy feature. Support
316can be enabled by writing 1 to memory.use_hierarchy file of the root cgroup
317
318# echo 1 > memory.use_hierarchy
319
320The feature can be disabled by
321
322# echo 0 > memory.use_hierarchy
323
324NOTE1: Enabling/disabling will fail if the cgroup already has other
325cgroups created below it.
326
327NOTE2: This feature can be enabled/disabled per subtree.
328
3297. TODO
294 330
2951. Add support for accounting huge pages (as a separate controller) 3311. Add support for accounting huge pages (as a separate controller)
2962. Make per-cgroup scanner reclaim not-shared pages first 3322. Make per-cgroup scanner reclaim not-shared pages first