mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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). [[email protected]: fix build] [[email protected]: hugetlb: hang off of /sys/kernel/mm rather than /sys/kernel] [[email protected]: hugetlb: remove CONFIG_SYSFS dependency] Acked-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Nishanth Aravamudan <[email protected]> Signed-off-by: Nick Piggin <[email protected]> Cc: Dave Hansen <[email protected]> Signed-off-by: Nishanth Aravamudan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
a137e1cc6d
commit
a343787016
4 changed files with 262 additions and 66 deletions
|
|
@ -95,6 +95,29 @@ this condition holds, however, no more surplus huge pages will be
|
|||
allowed on the system until one of the two sysctls are increased
|
||||
sufficiently, or the surplus huge pages go out of use and are freed.
|
||||
|
||||
With support for multiple hugepage pools at run-time available, much of
|
||||
the hugepage userspace interface has been duplicated in sysfs. The above
|
||||
information applies to the default hugepage size (which will be
|
||||
controlled by the proc interfaces for backwards compatibility). The root
|
||||
hugepage control directory is
|
||||
|
||||
/sys/kernel/mm/hugepages
|
||||
|
||||
For each hugepage size supported by the running kernel, a subdirectory
|
||||
will exist, of the form
|
||||
|
||||
hugepages-${size}kB
|
||||
|
||||
Inside each of these directories, the same set of files will exist:
|
||||
|
||||
nr_hugepages
|
||||
nr_overcommit_hugepages
|
||||
free_hugepages
|
||||
resv_hugepages
|
||||
surplus_hugepages
|
||||
|
||||
which function as described above for the default hugepage-sized case.
|
||||
|
||||
If the user applications are going to request hugepages using mmap system
|
||||
call, then it is required that system administrator mount a file system of
|
||||
type hugetlbfs:
|
||||
|
|
|
|||
Loading…
Reference in a new issue