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