aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/vm
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2008-07-24 00:27:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 13:47:17 -0400
commita3437870160cf2caaac6bdd76c7377a5a4145a8c (patch)
tree6d3c8ddd442e4cd96f1f8bdcf59fcaef72f4edc9 /Documentation/vm
parenta137e1cc6d6e7d315fef03962a2a5a113348b13b (diff)
hugetlb: new sysfs interface
Provide new hugepages user APIs that are more suited to multiple hstates in sysfs. There is a new directory, /sys/kernel/hugepages. Underneath that directory there will be a directory per-supported hugepage size, e.g.: /sys/kernel/hugepages/hugepages-64kB /sys/kernel/hugepages/hugepages-16384kB /sys/kernel/hugepages/hugepages-16777216kB corresponding to 64k, 16m and 16g respectively. Within each hugepages-size directory there are a number of files, corresponding to the tracked counters in the hstate, e.g.: /sys/kernel/hugepages/hugepages-64/nr_hugepages /sys/kernel/hugepages/hugepages-64/nr_overcommit_hugepages /sys/kernel/hugepages/hugepages-64/free_hugepages /sys/kernel/hugepages/hugepages-64/resv_hugepages /sys/kernel/hugepages/hugepages-64/surplus_hugepages Of these files, the first two are read-write and the latter three are read-only. The size of the hugepage being manipulated is trivially deducible from the enclosing directory and is always expressed in kB (to match meminfo). [dave@linux.vnet.ibm.com: fix build] [nacc@us.ibm.com: hugetlb: hang off of /sys/kernel/mm rather than /sys/kernel] [nacc@us.ibm.com: hugetlb: remove CONFIG_SYSFS dependency] Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Nick Piggin <npiggin@suse.de> Cc: Dave Hansen <dave@linux.vnet.ibm.com> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/vm')
-rw-r--r--Documentation/vm/hugetlbpage.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt
index 3102b81bef88..8a5b5763f0fe 100644
--- a/Documentation/vm/hugetlbpage.txt
+++ b/Documentation/vm/hugetlbpage.txt
@@ -95,6 +95,29 @@ this condition holds, however, no more surplus huge pages will be
95allowed on the system until one of the two sysctls are increased 95allowed on the system until one of the two sysctls are increased
96sufficiently, or the surplus huge pages go out of use and are freed. 96sufficiently, or the surplus huge pages go out of use and are freed.
97 97
98With support for multiple hugepage pools at run-time available, much of
99the hugepage userspace interface has been duplicated in sysfs. The above
100information applies to the default hugepage size (which will be
101controlled by the proc interfaces for backwards compatibility). The root
102hugepage control directory is
103
104 /sys/kernel/mm/hugepages
105
106For each hugepage size supported by the running kernel, a subdirectory
107will exist, of the form
108
109 hugepages-${size}kB
110
111Inside each of these directories, the same set of files will exist:
112
113 nr_hugepages
114 nr_overcommit_hugepages
115 free_hugepages
116 resv_hugepages
117 surplus_hugepages
118
119which function as described above for the default hugepage-sized case.
120
98If the user applications are going to request hugepages using mmap system 121If the user applications are going to request hugepages using mmap system
99call, then it is required that system administrator mount a file system of 122call, then it is required that system administrator mount a file system of
100type hugetlbfs: 123type hugetlbfs: