aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/cgroups/hugetlb.txt
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2012-07-31 19:42:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-31 21:42:41 -0400
commit585e27ea6d2e71d0091443c39a00a35e6a5c5e8f (patch)
tree2e8899e7df6d515eeaddf3aadfb29b6d890fc481 /Documentation/cgroups/hugetlb.txt
parent8e6ac7fab374816de9a8b0a8fbb02ef761a30ff4 (diff)
hugetlb/cgroup: add HugeTLB controller documentation
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: David Rientjes <rientjes@google.com> Cc: Hillf Danton <dhillf@gmail.com> Reviewed-by: Michal Hocko <mhocko@suse.cz> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/cgroups/hugetlb.txt')
-rw-r--r--Documentation/cgroups/hugetlb.txt45
1 files changed, 45 insertions, 0 deletions
diff --git a/Documentation/cgroups/hugetlb.txt b/Documentation/cgroups/hugetlb.txt
new file mode 100644
index 000000000000..a9faaca1f029
--- /dev/null
+++ b/Documentation/cgroups/hugetlb.txt
@@ -0,0 +1,45 @@
1HugeTLB Controller
2-------------------
3
4The HugeTLB controller allows to limit the HugeTLB usage per control group and
5enforces the controller limit during page fault. Since HugeTLB doesn't
6support page reclaim, enforcing the limit at page fault time implies that,
7the application will get SIGBUS signal if it tries to access HugeTLB pages
8beyond its limit. This requires the application to know beforehand how much
9HugeTLB pages it would require for its use.
10
11HugeTLB controller can be created by first mounting the cgroup filesystem.
12
13# mount -t cgroup -o hugetlb none /sys/fs/cgroup
14
15With the above step, the initial or the parent HugeTLB group becomes
16visible at /sys/fs/cgroup. At bootup, this group includes all the tasks in
17the system. /sys/fs/cgroup/tasks lists the tasks in this cgroup.
18
19New groups can be created under the parent group /sys/fs/cgroup.
20
21# cd /sys/fs/cgroup
22# mkdir g1
23# echo $$ > g1/tasks
24
25The above steps create a new group g1 and move the current shell
26process (bash) into it.
27
28Brief summary of control files
29
30 hugetlb.<hugepagesize>.limit_in_bytes # set/show limit of "hugepagesize" hugetlb usage
31 hugetlb.<hugepagesize>.max_usage_in_bytes # show max "hugepagesize" hugetlb usage recorded
32 hugetlb.<hugepagesize>.usage_in_bytes # show current res_counter usage for "hugepagesize" hugetlb
33 hugetlb.<hugepagesize>.failcnt # show the number of allocation failure due to HugeTLB limit
34
35For a system supporting two hugepage size (16M and 16G) the control
36files include:
37
38hugetlb.16GB.limit_in_bytes
39hugetlb.16GB.max_usage_in_bytes
40hugetlb.16GB.usage_in_bytes
41hugetlb.16GB.failcnt
42hugetlb.16MB.limit_in_bytes
43hugetlb.16MB.max_usage_in_bytes
44hugetlb.16MB.usage_in_bytes
45hugetlb.16MB.failcnt