Documentation: update hugetlb information

The hugetlb documentation has gotten a bit out of sync with the current code.
Updated the sysctl file to refer to Documentation/vm/hugetlbpage.txt. Update
that file to contain the current state of affairs (with the newer named sysctl
in place).

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Acked-by: Adam Litke <agl@us.ibm.com>
Cc: William Lee Irwin III <wli@holomorphy.com>
Cc: Dave Hansen <haveblue@us.ibm.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Nishanth Aravamudan and committed by Linus Torvalds d5dbac87 368d2c63

+48 -6
+19
Documentation/sysctl/vm.txt
··· 34 34 - oom_kill_allocating_task 35 35 - mmap_min_address 36 36 - numa_zonelist_order 37 + - nr_hugepages 38 + - nr_overcommit_hugepages 37 39 38 40 ============================================================== 39 41 ··· 307 305 308 306 Otherwise, "zone" order will be selected. Default order is recommended unless 309 307 this is causing problems for your system/application. 308 + 309 + ============================================================== 310 + 311 + nr_hugepages 312 + 313 + Change the minimum size of the hugepage pool. 314 + 315 + See Documentation/vm/hugetlbpage.txt 316 + 317 + ============================================================== 318 + 319 + nr_overcommit_hugepages 320 + 321 + Change the maximum size of the hugepage pool. The maximum is 322 + nr_hugepages + nr_overcommit_hugepages. 323 + 324 + See Documentation/vm/hugetlbpage.txt
+29 -6
Documentation/vm/hugetlbpage.txt
··· 30 30 The output of "cat /proc/meminfo" will have lines like: 31 31 32 32 ..... 33 - HugePages_Total: xxx 34 - HugePages_Free: yyy 35 - HugePages_Rsvd: www 33 + HugePages_Total: vvv 34 + HugePages_Free: www 35 + HugePages_Rsvd: xxx 36 + HugePages_Surp: yyy 36 37 Hugepagesize: zzz kB 37 38 38 39 where: ··· 43 42 HugePages_Rsvd is short for "reserved," and is the number of hugepages 44 43 for which a commitment to allocate from the pool has been made, but no 45 44 allocation has yet been made. It's vaguely analogous to overcommit. 45 + HugePages_Surp is short for "surplus," and is the number of hugepages in 46 + the pool above the value in /proc/sys/vm/nr_hugepages. The maximum 47 + number of surplus hugepages is controlled by 48 + /proc/sys/vm/nr_overcommit_hugepages. 46 49 47 50 /proc/filesystems should also show a filesystem of type "hugetlbfs" configured 48 51 in the kernel. ··· 76 71 memory that is preset in system at this time. System administrators may want 77 72 to put this command in one of the local rc init files. This will enable the 78 73 kernel to request huge pages early in the boot process (when the possibility 79 - of getting physical contiguous pages is still very high). 74 + of getting physical contiguous pages is still very high). In either 75 + case, adminstrators will want to verify the number of hugepages actually 76 + allocated by checking the sysctl or meminfo. 77 + 78 + /proc/sys/vm/nr_overcommit_hugepages indicates how large the pool of 79 + hugepages can grow, if more hugepages than /proc/sys/vm/nr_hugepages are 80 + requested by applications. echo'ing any non-zero value into this file 81 + indicates that the hugetlb subsystem is allowed to try to obtain 82 + hugepages from the buddy allocator, if the normal pool is exhausted. As 83 + these surplus hugepages go out of use, they are freed back to the buddy 84 + allocator. 85 + 86 + Caveat: Shrinking the pool via nr_hugepages while a surplus is in effect 87 + will allow the number of surplus huge pages to exceed the overcommit 88 + value, as the pool hugepages (which must have been in use for a surplus 89 + hugepages to be allocated) will become surplus hugepages. As long as 90 + this condition holds, however, no more surplus huge pages will be 91 + allowed on the system until one of the two sysctls are increased 92 + sufficiently, or the surplus huge pages go out of use and are freed. 80 93 81 94 If the user applications are going to request hugepages using mmap system 82 95 call, then it is required that system administrator mount a file system of ··· 117 94 options, you can use [G|g]/[M|m]/[K|k] to represent giga/mega/kilo. For 118 95 example, size=2K has the same meaning as size=2048. 119 96 120 - read and write system calls are not supported on files that reside on hugetlb 121 - file systems. 97 + While read system calls are supported on files that reside on hugetlb 98 + file systems, write system calls are not. 122 99 123 100 Regular chown, chgrp, and chmod commands (with right permissions) could be 124 101 used to change the file attributes on hugetlbfs.