aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/vm/hugetlbpage.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/vm/hugetlbpage.txt')
-rw-r--r--Documentation/vm/hugetlbpage.txt31
1 files changed, 20 insertions, 11 deletions
diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt
index 1ad9af1ca4d0..687104bfd09a 100644
--- a/Documentation/vm/hugetlbpage.txt
+++ b/Documentation/vm/hugetlbpage.txt
@@ -27,12 +27,21 @@ number of free hugetlb pages at any time. It also displays information about
27the configured hugepage size - this is needed for generating the proper 27the configured hugepage size - this is needed for generating the proper
28alignment and size of the arguments to the above system calls. 28alignment and size of the arguments to the above system calls.
29 29
30The output of "cat /proc/meminfo" will have output like: 30The output of "cat /proc/meminfo" will have lines like:
31 31
32..... 32.....
33HugePages_Total: xxx 33HugePages_Total: xxx
34HugePages_Free: yyy 34HugePages_Free: yyy
35Hugepagesize: zzz KB 35HugePages_Rsvd: www
36Hugepagesize: zzz kB
37
38where:
39HugePages_Total is the size of the pool of hugepages.
40HugePages_Free is the number of hugepages in the pool that are not yet
41allocated.
42HugePages_Rsvd is short for "reserved," and is the number of hugepages
43for which a commitment to allocate from the pool has been made, but no
44allocation has yet been made. It's vaguely analogous to overcommit.
36 45
37/proc/filesystems should also show a filesystem of type "hugetlbfs" configured 46/proc/filesystems should also show a filesystem of type "hugetlbfs" configured
38in the kernel. 47in the kernel.
@@ -42,11 +51,11 @@ pages in the kernel. Super user can dynamically request more (or free some
42pre-configured) hugepages. 51pre-configured) hugepages.
43The allocation (or deallocation) of hugetlb pages is possible only if there are 52The allocation (or deallocation) of hugetlb pages is possible only if there are
44enough physically contiguous free pages in system (freeing of hugepages is 53enough physically contiguous free pages in system (freeing of hugepages is
45possible only if there are enough hugetlb pages free that can be transfered 54possible only if there are enough hugetlb pages free that can be transferred
46back to regular memory pool). 55back to regular memory pool).
47 56
48Pages that are used as hugetlb pages are reserved inside the kernel and can 57Pages that are used as hugetlb pages are reserved inside the kernel and cannot
49not be used for other purposes. 58be used for other purposes.
50 59
51Once the kernel with Hugetlb page support is built and running, a user can 60Once the kernel with Hugetlb page support is built and running, a user can
52use either the mmap system call or shared memory system calls to start using 61use either the mmap system call or shared memory system calls to start using
@@ -60,7 +69,7 @@ Use the following command to dynamically allocate/deallocate hugepages:
60This command will try to configure 20 hugepages in the system. The success 69This command will try to configure 20 hugepages in the system. The success
61or failure of allocation depends on the amount of physically contiguous 70or failure of allocation depends on the amount of physically contiguous
62memory that is preset in system at this time. System administrators may want 71memory that is preset in system at this time. System administrators may want
63to put this command in one of the local rc init file. This will enable the 72to put this command in one of the local rc init files. This will enable the
64kernel to request huge pages early in the boot process (when the possibility 73kernel to request huge pages early in the boot process (when the possibility
65of getting physical contiguous pages is still very high). 74of getting physical contiguous pages is still very high).
66 75
@@ -78,8 +87,8 @@ the uid and gid of the current process are taken. The mode option sets the
78mode of root of file system to value & 0777. This value is given in octal. 87mode of root of file system to value & 0777. This value is given in octal.
79By default the value 0755 is picked. The size option sets the maximum value of 88By default the value 0755 is picked. The size option sets the maximum value of
80memory (huge pages) allowed for that filesystem (/mnt/huge). The size is 89memory (huge pages) allowed for that filesystem (/mnt/huge). The size is
81rounded down to HPAGE_SIZE. The option nr_inode sets the maximum number of 90rounded down to HPAGE_SIZE. The option nr_inodes sets the maximum number of
82inodes that /mnt/huge can use. If the size or nr_inode options are not 91inodes that /mnt/huge can use. If the size or nr_inodes options are not
83provided on command line then no limits are set. For size and nr_inodes 92provided on command line then no limits are set. For size and nr_inodes
84options, you can use [G|g]/[M|m]/[K|k] to represent giga/mega/kilo. For 93options, you can use [G|g]/[M|m]/[K|k] to represent giga/mega/kilo. For
85example, size=2K has the same meaning as size=2048. An example is given at 94example, size=2K has the same meaning as size=2048. An example is given at
@@ -88,7 +97,7 @@ the end of this document.
88read and write system calls are not supported on files that reside on hugetlb 97read and write system calls are not supported on files that reside on hugetlb
89file systems. 98file systems.
90 99
91A regular chown, chgrp and chmod commands (with right permissions) could be 100Regular chown, chgrp, and chmod commands (with right permissions) could be
92used to change the file attributes on hugetlbfs. 101used to change the file attributes on hugetlbfs.
93 102
94Also, it is important to note that no such mount command is required if the 103Also, it is important to note that no such mount command is required if the
@@ -96,8 +105,8 @@ applications are going to use only shmat/shmget system calls. Users who
96wish to use hugetlb page via shared memory segment should be a member of 105wish to use hugetlb page via shared memory segment should be a member of
97a supplementary group and system admin needs to configure that gid into 106a supplementary group and system admin needs to configure that gid into
98/proc/sys/vm/hugetlb_shm_group. It is possible for same or different 107/proc/sys/vm/hugetlb_shm_group. It is possible for same or different
99applications to use any combination of mmaps and shm* calls. Though the 108applications to use any combination of mmaps and shm* calls, though the
100mount of filesystem will be required for using mmaps. 109mount of filesystem will be required for using mmap calls.
101 110
102******************************************************************* 111*******************************************************************
103 112