Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127568
b: refs/heads/master
c: 52bc0d8
h: refs/heads/master
v: v3
  • Loading branch information
Balbir Singh authored and Linus Torvalds committed Jan 8, 2009
1 parent 3fc64e6 commit d1942f3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f8d665422603ee1b8ed04dcad4242f14d623c941
refs/heads/master: 52bc0d82100cd896213a9a25ec01c1ba87b939db
38 changes: 37 additions & 1 deletion trunk/Documentation/controllers/memory.txt
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,44 @@ will be charged as a new owner of it.
Because rmdir() moves all pages to parent, some out-of-use page caches can be
moved to the parent. If you want to avoid that, force_empty will be useful.

6. Hierarchy support

6. TODO
The memory controller supports a deep hierarchy and hierarchical accounting.
The hierarchy is created by creating the appropriate cgroups in the
cgroup filesystem. Consider for example, the following cgroup filesystem
hierarchy

root
/ | \
/ | \
a b c
| \
| \
d e

In the diagram above, with hierarchical accounting enabled, all memory
usage of e, is accounted to its ancestors up until the root (i.e, c and root),
that has memory.use_hierarchy enabled. If one of the ancestors goes over its
limit, the reclaim algorithm reclaims from the tasks in the ancestor and the
children of the ancestor.

6.1 Enabling hierarchical accounting and reclaim

The memory controller by default disables the hierarchy feature. Support
can be enabled by writing 1 to memory.use_hierarchy file of the root cgroup

# echo 1 > memory.use_hierarchy

The feature can be disabled by

# echo 0 > memory.use_hierarchy

NOTE1: Enabling/disabling will fail if the cgroup already has other
cgroups created below it.

NOTE2: This feature can be enabled/disabled per subtree.

7. TODO

1. Add support for accounting huge pages (as a separate controller)
2. Make per-cgroup scanner reclaim not-shared pages first
Expand Down

0 comments on commit d1942f3

Please sign in to comment.