sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget./translations/zh_CN/admin-guide/mm/hugetlbpagemodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget./translations/zh_TW/admin-guide/mm/hugetlbpagemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget./translations/it_IT/admin-guide/mm/hugetlbpagemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget./translations/ja_JP/admin-guide/mm/hugetlbpagemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget./translations/ko_KR/admin-guide/mm/hugetlbpagemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget./translations/sp_SP/admin-guide/mm/hugetlbpagemodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(h HugeTLB Pagesh]h HugeTLB Pages}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhH/var/lib/git/docbuild/linux/Documentation/admin-guide/mm/hugetlbpage.rsthKubh)}(hhh](h)}(hOverviewh]hOverview}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hXThe intent of this file is to give a brief summary of hugetlbpage support in the Linux kernel. This support is built on top of multiple page size support that is provided by most modern architectures. For example, x86 CPUs normally support 4K and 2M (1G if architecturally supported) page sizes, ia64 architecture supports multiple page sizes 4K, 8K, 64K, 256K, 1M, 4M, 16M, 256M and ppc64 supports 4K and 16M. A TLB is a cache of virtual-to-physical translations. Typically this is a very scarce resource on processor. Operating systems try to make best use of limited number of TLB resources. This optimization is more critical now as bigger and bigger physical memories (several GBs) are more readily available.h]hXThe intent of this file is to give a brief summary of hugetlbpage support in the Linux kernel. This support is built on top of multiple page size support that is provided by most modern architectures. For example, x86 CPUs normally support 4K and 2M (1G if architecturally supported) page sizes, ia64 architecture supports multiple page sizes 4K, 8K, 64K, 256K, 1M, 4M, 16M, 256M and ppc64 supports 4K and 16M. A TLB is a cache of virtual-to-physical translations. Typically this is a very scarce resource on processor. Operating systems try to make best use of limited number of TLB resources. This optimization is more critical now as bigger and bigger physical memories (several GBs) are more readily available.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hUsers can use the huge page support in Linux kernel by either using the mmap system call or standard SYSV shared memory system calls (shmget, shmat).h]hUsers can use the huge page support in Linux kernel by either using the mmap system call or standard SYSV shared memory system calls (shmget, shmat).}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hFirst the Linux kernel needs to be built with the CONFIG_HUGETLBFS (present under "File systems") and CONFIG_HUGETLB_PAGE (selected automatically when CONFIG_HUGETLBFS is selected) configuration options.h]hFirst the Linux kernel needs to be built with the CONFIG_HUGETLBFS (present under “File systems”) and CONFIG_HUGETLB_PAGE (selected automatically when CONFIG_HUGETLBFS is selected) configuration options.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXThe ``/proc/meminfo`` file provides information about the total number of persistent hugetlb pages in the kernel's huge page pool. It also displays default huge page size and information about the number of free, reserved and surplus huge pages in the pool of huge pages of default size. The huge page size is needed for generating the proper alignment and size of the arguments to system calls that map huge page regions.h](hThe }(hhhhhNhNubhliteral)}(h``/proc/meminfo``h]h /proc/meminfo}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhubhX file provides information about the total number of persistent hugetlb pages in the kernel’s huge page pool. It also displays default huge page size and information about the number of free, reserved and surplus huge pages in the pool of huge pages of default size. The huge page size is needed for generating the proper alignment and size of the arguments to system calls that map huge page regions.}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(h=The output of ``cat /proc/meminfo`` will include lines like::h](hThe output of }(hjhhhNhNubh)}(h``cat /proc/meminfo``h]hcat /proc/meminfo}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh will include lines like:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK"hhhhubh literal_block)}(hHugePages_Total: uuu HugePages_Free: vvv HugePages_Rsvd: www HugePages_Surp: xxx Hugepagesize: yyy kB Hugetlb: zzz kBh]hHugePages_Total: uuu HugePages_Free: vvv HugePages_Rsvd: www HugePages_Surp: xxx Hugepagesize: yyy kB Hugetlb: zzz kB}hj8sbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1j6hhhK$hhhhubh)}(hwhere:h]hwhere:}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK+hhhhubhdefinition_list)}(hhh](hdefinition_list_item)}(h6HugePages_Total is the size of the pool of huge pages.h](hterm)}(hHugePages_Totalh]hHugePages_Total}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1jahhhK-hj]ubh definition)}(hhh]h)}(h&is the size of the pool of huge pages.h]h&is the size of the pool of huge pages.}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hjsubah}(h]h ]h"]h$]h&]uh1jqhj]ubeh}(h]h ]h"]h$]h&]uh1j[hhhK-hjXubj\)}(hRHugePages_Free is the number of huge pages in the pool that are not yet allocated.h](jb)}(hHugePages_Freeh]hHugePages_Free}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jahhhK0hjubjr)}(hhh]h)}(hCis the number of huge pages in the pool that are not yet allocated.h]hCis the number of huge pages in the pool that are not yet allocated.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK0hjubah}(h]h ]h"]h$]h&]uh1jqhjubeh}(h]h ]h"]h$]h&]uh1j[hhhK0hjXhhubj\)}(hX/HugePages_Rsvd is short for "reserved," and is the number of huge pages for which a commitment to allocate from the pool has been made, but no allocation has yet been made. Reserved huge pages guarantee that an application will be able to allocate a huge page from the pool of huge pages at fault time.h](jb)}(hHugePages_Rsvdh]hHugePages_Rsvd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jahhhK6hjubjr)}(hhh]h)}(hX is short for "reserved," and is the number of huge pages for which a commitment to allocate from the pool has been made, but no allocation has yet been made. Reserved huge pages guarantee that an application will be able to allocate a huge page from the pool of huge pages at fault time.h]hX$is short for “reserved,” and is the number of huge pages for which a commitment to allocate from the pool has been made, but no allocation has yet been made. Reserved huge pages guarantee that an application will be able to allocate a huge page from the pool of huge pages at fault time.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK3hjubah}(h]h ]h"]h$]h&]uh1jqhjubeh}(h]h ]h"]h$]h&]uh1j[hhhK6hjXhhubj\)}(hXHugePages_Surp is short for "surplus," and is the number of huge pages in the pool above the value in ``/proc/sys/vm/nr_hugepages``. The maximum number of surplus huge pages is controlled by ``/proc/sys/vm/nr_overcommit_hugepages``. Note: When the feature of freeing unused vmemmap pages associated with each hugetlb page is enabled, the number of surplus huge pages may be temporarily larger than the maximum number of surplus huge pages when the system is under memory pressure.h](jb)}(hHugePages_Surph]hHugePages_Surp}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jahhhK?hjubjr)}(hhh]h)}(hXis short for "surplus," and is the number of huge pages in the pool above the value in ``/proc/sys/vm/nr_hugepages``. The maximum number of surplus huge pages is controlled by ``/proc/sys/vm/nr_overcommit_hugepages``. Note: When the feature of freeing unused vmemmap pages associated with each hugetlb page is enabled, the number of surplus huge pages may be temporarily larger than the maximum number of surplus huge pages when the system is under memory pressure.h](h[is short for “surplus,” and is the number of huge pages in the pool above the value in }(hjhhhNhNubh)}(h``/proc/sys/vm/nr_hugepages``h]h/proc/sys/vm/nr_hugepages}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh<. The maximum number of surplus huge pages is controlled by }(hjhhhNhNubh)}(h(``/proc/sys/vm/nr_overcommit_hugepages``h]h$/proc/sys/vm/nr_overcommit_hugepages}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh. Note: When the feature of freeing unused vmemmap pages associated with each hugetlb page is enabled, the number of surplus huge pages may be temporarily larger than the maximum number of surplus huge pages when the system is under memory pressure.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK9hjubah}(h]h ]h"]h$]h&]uh1jqhjubeh}(h]h ]h"]h$]h&]uh1j[hhhK?hjXhhubj\)}(h2Hugepagesize is the default hugepage size (in kB).h](jb)}(h Hugepagesizeh]h Hugepagesize}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1jahhhKAhjAubjr)}(hhh]h)}(h%is the default hugepage size (in kB).h]h%is the default hugepage size (in kB).}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKBhjSubah}(h]h ]h"]h$]h&]uh1jqhjAubeh}(h]h ]h"]h$]h&]uh1j[hhhKAhjXhhubj\)}(hXHugetlb is the total amount of memory (in kB), consumed by huge pages of all sizes. If huge pages of different sizes are in use, this number will exceed HugePages_Total \* Hugepagesize. To get more detailed information, please, refer to ``/sys/kernel/mm/hugepages`` (described below). h](jb)}(hHugetlbh]hHugetlb}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1jahhhKJhjpubjr)}(hhh]h)}(hXis the total amount of memory (in kB), consumed by huge pages of all sizes. If huge pages of different sizes are in use, this number will exceed HugePages_Total \* Hugepagesize. To get more detailed information, please, refer to ``/sys/kernel/mm/hugepages`` (described below).h](his the total amount of memory (in kB), consumed by huge pages of all sizes. If huge pages of different sizes are in use, this number will exceed HugePages_Total * Hugepagesize. To get more detailed information, please, refer to }(hjhhhNhNubh)}(h``/sys/kernel/mm/hugepages``h]h/sys/kernel/mm/hugepages}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh (described below).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKDhjubah}(h]h ]h"]h$]h&]uh1jqhjpubeh}(h]h ]h"]h$]h&]uh1j[hhhKJhjXhhubeh}(h]h ]h"]h$]h&]uh1jVhhhhhhhNubh)}(ha``/proc/filesystems`` should also show a filesystem of type "hugetlbfs" configured in the kernel.h](h)}(h``/proc/filesystems``h]h/proc/filesystems}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhP should also show a filesystem of type “hugetlbfs” configured in the kernel.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKLhhhhubh)}(hXd``/proc/sys/vm/nr_hugepages`` indicates the current number of "persistent" huge pages in the kernel's huge page pool. "Persistent" huge pages will be returned to the huge page pool when freed by a task. A user with root privileges can dynamically allocate more or free some persistent huge pages by increasing or decreasing the value of ``nr_hugepages``.h](h)}(h``/proc/sys/vm/nr_hugepages``h]h/proc/sys/vm/nr_hugepages}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhX@ indicates the current number of “persistent” huge pages in the kernel’s huge page pool. “Persistent” huge pages will be returned to the huge page pool when freed by a task. A user with root privileges can dynamically allocate more or free some persistent huge pages by increasing or decreasing the value of }(hjhhhNhNubh)}(h``nr_hugepages``h]h nr_hugepages}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKOhhhhubh)}(hNote: When the feature of freeing unused vmemmap pages associated with each hugetlb page is enabled, we can fail to free the huge pages triggered by the user when the system is under memory pressure. Please try again later.h]hNote: When the feature of freeing unused vmemmap pages associated with each hugetlb page is enabled, we can fail to free the huge pages triggered by the user when the system is under memory pressure. Please try again later.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKUhhhhubh)}(hPages that are used as huge pages are reserved inside the kernel and cannot be used for other purposes. Huge pages cannot be swapped out under memory pressure.h]hPages that are used as huge pages are reserved inside the kernel and cannot be used for other purposes. Huge pages cannot be swapped out under memory pressure.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKYhhhhubh)}(hXOnce a number of huge pages have been pre-allocated to the kernel huge page pool, a user with appropriate privilege can use either the mmap system call or shared memory system calls to use the huge pages. See the discussion of :ref:`Using Huge Pages `, below.h](hOnce a number of huge pages have been pre-allocated to the kernel huge page pool, a user with appropriate privilege can use either the mmap system call or shared memory system calls to use the huge pages. See the discussion of }(hjhhhNhNubh)}(h*:ref:`Using Huge Pages `h]hinline)}(hj'h]hUsing Huge Pages}(hj+hhhNhNubah}(h]h ](xrefstdstd-refeh"]h$]h&]uh1j)hj%ubah}(h]h ]h"]h$]h&]refdocadmin-guide/mm/hugetlbpage refdomainj6reftyperef refexplicitrefwarn reftargetusing_huge_pagesuh1hhhhK]hjubh, below.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK]hhhhubh)}(hXThe administrator can allocate persistent huge pages on the kernel boot command line by specifying the "hugepages=N" parameter, where 'N' = the number of huge pages requested. This is the most reliable method of allocating huge pages as memory has not yet become fragmented.h]hXThe administrator can allocate persistent huge pages on the kernel boot command line by specifying the “hugepages=N” parameter, where ‘N’ = the number of huge pages requested. This is the most reliable method of allocating huge pages as memory has not yet become fragmented.}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKbhhhhubh)}(hX|Some platforms support multiple huge page sizes. To allocate huge pages of a specific size, one must precede the huge pages boot command parameters with a huge page size selection parameter "hugepagesz=". must be specified in bytes with optional scale suffix [kKmMgG]. The default huge page size may be selected with the "default_hugepagesz=" boot parameter.h]hXSome platforms support multiple huge page sizes. To allocate huge pages of a specific size, one must precede the huge pages boot command parameters with a huge page size selection parameter “hugepagesz=”. must be specified in bytes with optional scale suffix [kKmMgG]. The default huge page size may be selected with the “default_hugepagesz=” boot parameter.}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKghhhhubh)}(h-Hugetlb boot command line parameter semanticsh]h-Hugetlb boot command line parameter semantics}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKmhhhhubjW)}(hhh](j\)}(hXhugepagesz Specify a huge page size. Used in conjunction with hugepages parameter to preallocate a number of huge pages of the specified size. Hence, hugepagesz and hugepages are typically specified in pairs such as:: hugepagesz=2M hugepages=512 hugepagesz can only be specified once on the command line for a specific huge page size. Valid huge page sizes are architecture dependent.h](jb)}(h hugepageszh]h hugepagesz}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jahhhKxhjubjr)}(hhh](h)}(hSpecify a huge page size. Used in conjunction with hugepages parameter to preallocate a number of huge pages of the specified size. Hence, hugepagesz and hugepages are typically specified in pairs such as::h]hSpecify a huge page size. Used in conjunction with hugepages parameter to preallocate a number of huge pages of the specified size. Hence, hugepagesz and hugepages are typically specified in pairs such as:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKphjubj7)}(hhugepagesz=2M hugepages=512h]hhugepagesz=2M hugepages=512}hjsbah}(h]h ]h"]h$]h&]jFjGuh1j6hhhKuhjubh)}(hhugepagesz can only be specified once on the command line for a specific huge page size. Valid huge page sizes are architecture dependent.h]hhugepagesz can only be specified once on the command line for a specific huge page size. Valid huge page sizes are architecture dependent.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKwhjubeh}(h]h ]h"]h$]h&]uh1jqhjubeh}(h]h ]h"]h$]h&]uh1j[hhhKxhj~ubj\)}(hXQhugepages Specify the number of huge pages to preallocate. This typically follows a valid hugepagesz or default_hugepagesz parameter. However, if hugepages is the first or only hugetlb command line parameter it implicitly specifies the number of huge pages of default size to allocate. If the number of huge pages of default size is implicitly specified, it can not be overwritten by a hugepagesz,hugepages parameter pair for the default size. This parameter also has a node format. The node format specifies the number of huge pages to allocate on specific nodes. For example, on an architecture with 2M default huge page size:: hugepages=256 hugepagesz=2M hugepages=512 will result in 256 2M huge pages being allocated and a warning message indicating that the hugepages=512 parameter is ignored. If a hugepages parameter is preceded by an invalid hugepagesz parameter, it will be ignored. Node format example:: hugepagesz=2M hugepages=0:1,1:2 It will allocate 1 2M hugepage on node0 and 2 2M hugepages on node1. If the node number is invalid, the parameter will be ignored.h](jb)}(h hugepagesh]h hugepages}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jahhhKhjubjr)}(hhh](h)}(hX/Specify the number of huge pages to preallocate. This typically follows a valid hugepagesz or default_hugepagesz parameter. However, if hugepages is the first or only hugetlb command line parameter it implicitly specifies the number of huge pages of default size to allocate. If the number of huge pages of default size is implicitly specified, it can not be overwritten by a hugepagesz,hugepages parameter pair for the default size. This parameter also has a node format. The node format specifies the number of huge pages to allocate on specific nodes.h]hX/Specify the number of huge pages to preallocate. This typically follows a valid hugepagesz or default_hugepagesz parameter. However, if hugepages is the first or only hugetlb command line parameter it implicitly specifies the number of huge pages of default size to allocate. If the number of huge pages of default size is implicitly specified, it can not be overwritten by a hugepagesz,hugepages parameter pair for the default size. This parameter also has a node format. The node format specifies the number of huge pages to allocate on specific nodes.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK{hjubh)}(h@For example, on an architecture with 2M default huge page size::h]h?For example, on an architecture with 2M default huge page size:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubj7)}(h)hugepages=256 hugepagesz=2M hugepages=512h]h)hugepages=256 hugepagesz=2M hugepages=512}hjsbah}(h]h ]h"]h$]h&]jFjGuh1j6hhhKhjubh)}(hwill result in 256 2M huge pages being allocated and a warning message indicating that the hugepages=512 parameter is ignored. If a hugepages parameter is preceded by an invalid hugepagesz parameter, it will be ignored.h]hwill result in 256 2M huge pages being allocated and a warning message indicating that the hugepages=512 parameter is ignored. If a hugepages parameter is preceded by an invalid hugepagesz parameter, it will be ignored.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hNode format example::h]hNode format example:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubj7)}(hhugepagesz=2M hugepages=0:1,1:2h]hhugepagesz=2M hugepages=0:1,1:2}hj'sbah}(h]h ]h"]h$]h&]jFjGuh1j6hhhKhjubh)}(hIt will allocate 1 2M hugepage on node0 and 2 2M hugepages on node1. If the node number is invalid, the parameter will be ignored.h]hIt will allocate 1 2M hugepage on node0 and 2 2M hugepages on node1. If the node number is invalid, the parameter will be ignored.}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1jqhjubeh}(h]h ]h"]h$]h&]uh1j[hhhKhj~hhubj\)}(hXhugepage_alloc_threads Specify the number of threads that should be used to allocate hugepages during boot. This parameter can be used to improve system bootup time when allocating a large amount of huge pages. The default value is 25% of the available hardware threads. Example to use 8 allocation threads:: hugepage_alloc_threads=8 Note that this parameter only applies to non-gigantic huge pages.h](jb)}(hhugepage_alloc_threadsh]hhugepage_alloc_threads}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1jahhhKhjOubjr)}(hhh](h)}(hSpecify the number of threads that should be used to allocate hugepages during boot. This parameter can be used to improve system bootup time when allocating a large amount of huge pages.h]hSpecify the number of threads that should be used to allocate hugepages during boot. This parameter can be used to improve system bootup time when allocating a large amount of huge pages.}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjaubh)}(haThe default value is 25% of the available hardware threads. Example to use 8 allocation threads::h]h`The default value is 25% of the available hardware threads. Example to use 8 allocation threads:}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjaubj7)}(hhugepage_alloc_threads=8h]hhugepage_alloc_threads=8}hjsbah}(h]h ]h"]h$]h&]jFjGuh1j6hhhKhjaubh)}(hANote that this parameter only applies to non-gigantic huge pages.h]hANote that this parameter only applies to non-gigantic huge pages.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjaubeh}(h]h ]h"]h$]h&]uh1jqhjOubeh}(h]h ]h"]h$]h&]uh1j[hhhKhj~hhubj\)}(hXdefault_hugepagesz Specify the default huge page size. This parameter can only be specified once on the command line. default_hugepagesz can optionally be followed by the hugepages parameter to preallocate a specific number of huge pages of default size. The number of default sized huge pages to preallocate can also be implicitly specified as mentioned in the hugepages section above. Therefore, on an architecture with 2M default huge page size:: hugepages=256 default_hugepagesz=2M hugepages=256 hugepages=256 default_hugepagesz=2M will all result in 256 2M huge pages being allocated. Valid default huge page size is architecture dependent.h](jb)}(hdefault_hugepageszh]hdefault_hugepagesz}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jahhhKhjubjr)}(hhh](h)}(hXSpecify the default huge page size. This parameter can only be specified once on the command line. default_hugepagesz can optionally be followed by the hugepages parameter to preallocate a specific number of huge pages of default size. The number of default sized huge pages to preallocate can also be implicitly specified as mentioned in the hugepages section above. Therefore, on an architecture with 2M default huge page size::h]hXSpecify the default huge page size. This parameter can only be specified once on the command line. default_hugepagesz can optionally be followed by the hugepages parameter to preallocate a specific number of huge pages of default size. The number of default sized huge pages to preallocate can also be implicitly specified as mentioned in the hugepages section above. Therefore, on an architecture with 2M default huge page size:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubj7)}(hUhugepages=256 default_hugepagesz=2M hugepages=256 hugepages=256 default_hugepagesz=2Mh]hUhugepages=256 default_hugepagesz=2M hugepages=256 hugepages=256 default_hugepagesz=2M}hjsbah}(h]h ]h"]h$]h&]jFjGuh1j6hhhKhjubh)}(hnwill all result in 256 2M huge pages being allocated. Valid default huge page size is architecture dependent.h]hnwill all result in 256 2M huge pages being allocated. Valid default huge page size is architecture dependent.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1jqhjubeh}(h]h ]h"]h$]h&]uh1j[hhhKhj~hhubj\)}(hxhugetlb_free_vmemmap When CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP is set, this enables HugeTLB Vmemmap Optimization (HVO). h](jb)}(hhugetlb_free_vmemmaph]hhugetlb_free_vmemmap}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jahhhKhjubjr)}(hhh]h)}(hbWhen CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP is set, this enables HugeTLB Vmemmap Optimization (HVO).h]hbWhen CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP is set, this enables HugeTLB Vmemmap Optimization (HVO).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jqhjubeh}(h]h ]h"]h$]h&]uh1j[hhhKhj~hhubeh}(h]h ]h"]h$]h&]uh1jVhhhhhhhNubh)}(hX When multiple huge page sizes are supported, ``/proc/sys/vm/nr_hugepages`` indicates the current number of pre-allocated huge pages of the default size. Thus, one can use the following command to dynamically allocate/deallocate default sized persistent huge pages::h](h-When multiple huge page sizes are supported, }(hj(hhhNhNubh)}(h``/proc/sys/vm/nr_hugepages``h]h/proc/sys/vm/nr_hugepages}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj(ubh indicates the current number of pre-allocated huge pages of the default size. Thus, one can use the following command to dynamically allocate/deallocate default sized persistent huge pages:}(hj(hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubj7)}(h#echo 20 > /proc/sys/vm/nr_hugepagesh]h#echo 20 > /proc/sys/vm/nr_hugepages}hjHsbah}(h]h ]h"]h$]h&]jFjGuh1j6hhhKhhhhubh)}(hThis command will try to adjust the number of default sized huge pages in the huge page pool to 20, allocating or freeing huge pages, as required.h]hThis command will try to adjust the number of default sized huge pages in the huge page pool to 20, allocating or freeing huge pages, as required.}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXyOn a NUMA platform, the kernel will attempt to distribute the huge page pool over all the set of allowed nodes specified by the NUMA memory policy of the task that modifies ``nr_hugepages``. The default for the allowed nodes--when the task has default memory policy--is all on-line nodes with memory. Allowed nodes with insufficient available, contiguous memory for a huge page will be silently skipped when allocating persistent huge pages. See the :ref:`discussion below ` of the interaction of task memory policy, cpusets and per node attributes with the allocation and freeing of persistent huge pages.h](hOn a NUMA platform, the kernel will attempt to distribute the huge page pool over all the set of allowed nodes specified by the NUMA memory policy of the task that modifies }(hjdhhhNhNubh)}(h``nr_hugepages``h]h nr_hugepages}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjdubhX. The default for the allowed nodes--when the task has default memory policy--is all on-line nodes with memory. Allowed nodes with insufficient available, contiguous memory for a huge page will be silently skipped when allocating persistent huge pages. See the }(hjdhhhNhNubh)}(h1:ref:`discussion below `h]j*)}(hjh]hdiscussion below}(hjhhhNhNubah}(h]h ](j5stdstd-refeh"]h$]h&]uh1j)hj~ubah}(h]h ]h"]h$]h&]refdocjB refdomainjreftyperef refexplicitrefwarnjHmem_policy_and_hp_allocuh1hhhhKhjdubh of the interaction of task memory policy, cpusets and per node attributes with the allocation and freeing of persistent huge pages.}(hjdhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXThe success or failure of huge page allocation depends on the amount of physically contiguous memory that is present in system at the time of the allocation attempt. If the kernel is unable to allocate huge pages from some nodes in a NUMA system, it will attempt to make up the difference by allocating extra pages on other nodes with sufficient available contiguous memory, if any.h]hXThe success or failure of huge page allocation depends on the amount of physically contiguous memory that is present in system at the time of the allocation attempt. If the kernel is unable to allocate huge pages from some nodes in a NUMA system, it will attempt to make up the difference by allocating extra pages on other nodes with sufficient available contiguous memory, if any.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXSystem administrators may want to put this command in one of the local rc init files. This will enable the kernel to allocate huge pages early in the boot process when the possibility of getting physical contiguous pages is still very high. Administrators can verify the number of huge pages actually allocated by checking the sysctl or meminfo. To check the per node distribution of huge pages in a NUMA system, use::h]hXSystem administrators may want to put this command in one of the local rc init files. This will enable the kernel to allocate huge pages early in the boot process when the possibility of getting physical contiguous pages is still very high. Administrators can verify the number of huge pages actually allocated by checking the sysctl or meminfo. To check the per node distribution of huge pages in a NUMA system, use:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubj7)}(h7cat /sys/devices/system/node/node*/meminfo | fgrep Hugeh]h7cat /sys/devices/system/node/node*/meminfo | fgrep Huge}hjsbah}(h]h ]h"]h$]h&]jFjGuh1j6hhhKhhhhubh)}(hX``/proc/sys/vm/nr_overcommit_hugepages`` specifies how large the pool of huge pages can grow, if more huge pages than ``/proc/sys/vm/nr_hugepages`` are requested by applications. Writing any non-zero value into this file indicates that the hugetlb subsystem is allowed to try to obtain that number of "surplus" huge pages from the kernel's normal page pool, when the persistent huge page pool is exhausted. As these surplus huge pages become unused, they are freed back to the kernel's normal page pool.h](h)}(h(``/proc/sys/vm/nr_overcommit_hugepages``h]h$/proc/sys/vm/nr_overcommit_hugepages}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhN specifies how large the pool of huge pages can grow, if more huge pages than }(hjhhhNhNubh)}(h``/proc/sys/vm/nr_hugepages``h]h/proc/sys/vm/nr_hugepages}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhXm are requested by applications. Writing any non-zero value into this file indicates that the hugetlb subsystem is allowed to try to obtain that number of “surplus” huge pages from the kernel’s normal page pool, when the persistent huge page pool is exhausted. As these surplus huge pages become unused, they are freed back to the kernel’s normal page pool.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hX When increasing the huge page pool size via ``nr_hugepages``, any existing surplus pages will first be promoted to persistent huge pages. Then, additional huge pages will be allocated, if necessary and if possible, to fulfill the new persistent huge page pool size.h](h,When increasing the huge page pool size via }(hjhhhNhNubh)}(h``nr_hugepages``h]h nr_hugepages}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, any existing surplus pages will first be promoted to persistent huge pages. Then, additional huge pages will be allocated, if necessary and if possible, to fulfill the new persistent huge page pool size.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXThe administrator may shrink the pool of persistent huge pages for the default huge page size by setting the ``nr_hugepages`` sysctl to a smaller value. The kernel will attempt to balance the freeing of huge pages across all nodes in the memory policy of the task modifying ``nr_hugepages``. Any free huge pages on the selected nodes will be freed back to the kernel's normal page pool.h](hmThe administrator may shrink the pool of persistent huge pages for the default huge page size by setting the }(hj hhhNhNubh)}(h``nr_hugepages``h]h nr_hugepages}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh sysctl to a smaller value. The kernel will attempt to balance the freeing of huge pages across all nodes in the memory policy of the task modifying }(hj hhhNhNubh)}(h``nr_hugepages``h]h nr_hugepages}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubhb. Any free huge pages on the selected nodes will be freed back to the kernel’s normal page pool.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hX Caveat: Shrinking the persistent huge page pool via ``nr_hugepages`` such that it becomes less than the number of huge pages in use will convert the balance of the in-use huge pages to surplus huge pages. This will occur even if the number of surplus pages would exceed the overcommit value. As long as this condition holds--that is, until ``nr_hugepages+nr_overcommit_hugepages`` is increased sufficiently, or the surplus huge pages go out of use and are freed-- no more surplus huge pages will be allowed to be allocated.h](h4Caveat: Shrinking the persistent huge page pool via }(hjRhhhNhNubh)}(h``nr_hugepages``h]h nr_hugepages}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjRubhX such that it becomes less than the number of huge pages in use will convert the balance of the in-use huge pages to surplus huge pages. This will occur even if the number of surplus pages would exceed the overcommit value. As long as this condition holds--that is, until }(hjRhhhNhNubh)}(h(``nr_hugepages+nr_overcommit_hugepages``h]h$nr_hugepages+nr_overcommit_hugepages}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjRubh is increased sufficiently, or the surplus huge pages go out of use and are freed-- no more surplus huge pages will be allowed to be allocated.}(hjRhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hX(With support for multiple huge page pools at run-time available, much of the huge page userspace interface in ``/proc/sys/vm`` has been duplicated in sysfs. The ``/proc`` interfaces discussed above have been retained for backwards compatibility. The root huge page control directory in sysfs is::h](hnWith support for multiple huge page pools at run-time available, much of the huge page userspace interface in }(hjhhhNhNubh)}(h``/proc/sys/vm``h]h /proc/sys/vm}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh# has been duplicated in sysfs. The }(hjhhhNhNubh)}(h ``/proc``h]h/proc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh} interfaces discussed above have been retained for backwards compatibility. The root huge page control directory in sysfs is:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubj7)}(h/sys/kernel/mm/hugepagesh]h/sys/kernel/mm/hugepages}hjsbah}(h]h ]h"]h$]h&]jFjGuh1j6hhhKhhhhubh)}(haFor each huge page size supported by the running kernel, a subdirectory will exist, of the form::h]h`For each huge page size supported by the running kernel, a subdirectory will exist, of the form:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubj7)}(hhugepages-${size}kBh]hhugepages-${size}kB}hjsbah}(h]h ]h"]h$]h&]jFjGuh1j6hhhKhhhhubh)}(hInside each of these directories, the set of files contained in ``/proc`` will exist. In addition, two additional interfaces for demoting huge pages may exist::h](h@Inside each of these directories, the set of files contained in }(hjhhhNhNubh)}(h ``/proc``h]h/proc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhW will exist. In addition, two additional interfaces for demoting huge pages may exist:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubj7)}(h~demote demote_size nr_hugepages nr_hugepages_mempolicy nr_overcommit_hugepages free_hugepages resv_hugepages surplus_hugepagesh]h~demote demote_size nr_hugepages nr_hugepages_mempolicy nr_overcommit_hugepages free_hugepages resv_hugepages surplus_hugepages}hjsbah}(h]h ]h"]h$]h&]jFjGuh1j6hhhMhhhhubh)}(hX?The demote interfaces provide the ability to split a huge page into smaller huge pages. For example, the x86 architecture supports both 1GB and 2MB huge pages sizes. A 1GB huge page can be split into 512 2MB huge pages. Demote interfaces are not available for the smallest huge page size. The demote interfaces are:h]hX?The demote interfaces provide the ability to split a huge page into smaller huge pages. For example, the x86 architecture supports both 1GB and 2MB huge pages sizes. A 1GB huge page can be split into 512 2MB huge pages. Demote interfaces are not available for the smallest huge page size. The demote interfaces are:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hhhhubjW)}(hhh](j\)}(hXzdemote_size is the size of demoted pages. When a page is demoted a corresponding number of huge pages of demote_size will be created. By default, demote_size is set to the next smaller huge page size. If there are multiple smaller huge page sizes, demote_size can be set to any of these smaller sizes. Only huge page sizes less than the current huge pages size are allowed. h](jb)}(h demote_sizeh]h demote_size}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1jahhhMhjubjr)}(hhh]h)}(hXmis the size of demoted pages. When a page is demoted a corresponding number of huge pages of demote_size will be created. By default, demote_size is set to the next smaller huge page size. If there are multiple smaller huge page sizes, demote_size can be set to any of these smaller sizes. Only huge page sizes less than the current huge pages size are allowed.h]hXmis the size of demoted pages. When a page is demoted a corresponding number of huge pages of demote_size will be created. By default, demote_size is set to the next smaller huge page size. If there are multiple smaller huge page sizes, demote_size can be set to any of these smaller sizes. Only huge page sizes less than the current huge pages size are allowed.}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj1ubah}(h]h ]h"]h$]h&]uh1jqhjubeh}(h]h ]h"]h$]h&]uh1j[hhhMhjubj\)}(hXWdemote is used to demote a number of huge pages. A user with root privileges can write to this file. It may not be possible to demote the requested number of huge pages. To determine how many pages were actually demoted, compare the value of nr_hugepages before and after writing to the demote interface. demote is a write only interface. h](jb)}(hdemoteh]hdemote}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1jahhhMhjNubjr)}(hhh]h)}(hXOis used to demote a number of huge pages. A user with root privileges can write to this file. It may not be possible to demote the requested number of huge pages. To determine how many pages were actually demoted, compare the value of nr_hugepages before and after writing to the demote interface. demote is a write only interface.h]hXOis used to demote a number of huge pages. A user with root privileges can write to this file. It may not be possible to demote the requested number of huge pages. To determine how many pages were actually demoted, compare the value of nr_hugepages before and after writing to the demote interface. demote is a write only interface.}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj`ubah}(h]h ]h"]h$]h&]uh1jqhjNubeh}(h]h ]h"]h$]h&]uh1j[hhhMhjhhubeh}(h]h ]h"]h$]h&]uh1jVhhhhhhhNubh)}(hThe interfaces which are the same as in ``/proc`` (all except demote and demote_size) function as described above for the default huge page-sized case.h](h(The interfaces which are the same as in }(hjhhhNhNubh)}(h ``/proc``h]h/proc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhf (all except demote and demote_size) function as described above for the default huge page-sized case.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM!hhhhubhtarget)}(h.. _mem_policy_and_hp_alloc:h]h}(h]h ]h"]h$]h&]refidmem-policy-and-hp-allocuh1jhM$hhhhhhubeh}(h]overviewah ]h"]overviewah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hCInteraction of Task Memory Policy with Huge Page Allocation/Freeingh]hCInteraction of Task Memory Policy with Huge Page Allocation/Freeing}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM'ubh)}(hXWhether huge pages are allocated and freed via the ``/proc`` interface or the ``/sysfs`` interface using the ``nr_hugepages_mempolicy`` attribute, the NUMA nodes from which huge pages are allocated or freed are controlled by the NUMA memory policy of the task that modifies the ``nr_hugepages_mempolicy`` sysctl or attribute. When the ``nr_hugepages`` attribute is used, mempolicy is ignored.h](h3Whether huge pages are allocated and freed via the }(hjhhhNhNubh)}(h ``/proc``h]h/proc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh interface or the }(hjhhhNhNubh)}(h ``/sysfs``h]h/sysfs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh interface using the }(hjhhhNhNubh)}(h``nr_hugepages_mempolicy``h]hnr_hugepages_mempolicy}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh attribute, the NUMA nodes from which huge pages are allocated or freed are controlled by the NUMA memory policy of the task that modifies the }(hjhhhNhNubh)}(h``nr_hugepages_mempolicy``h]hnr_hugepages_mempolicy}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh sysctl or attribute. When the }(hjhhhNhNubh)}(h``nr_hugepages``h]h nr_hugepages}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh) attribute is used, mempolicy is ignored.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM)hjhhubh)}(hThe recommended method to allocate or free huge pages to/from the kernel huge page pool, using the ``nr_hugepages`` example above, is::h](hcThe recommended method to allocate or free huge pages to/from the kernel huge page pool, using the }(hj2hhhNhNubh)}(h``nr_hugepages``h]h nr_hugepages}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj2ubh example above, is:}(hj2hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM0hjhhubj7)}(hknumactl --interleave echo 20 \ >/proc/sys/vm/nr_hugepages_mempolicyh]hknumactl --interleave echo 20 \ >/proc/sys/vm/nr_hugepages_mempolicy}hjRsbah}(h]h ]h"]h$]h&]jFjGuh1j6hhhM3hjhhubh)}(hor, more succinctly::h]hor, more succinctly:}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM6hjhhubj7)}(hCnumactl -m echo 20 >/proc/sys/vm/nr_hugepages_mempolicyh]hCnumactl -m echo 20 >/proc/sys/vm/nr_hugepages_mempolicy}hjnsbah}(h]h ]h"]h$]h&]jFjGuh1j6hhhM8hjhhubh)}(hX4This will allocate or free ``abs(20 - nr_hugepages)`` to or from the nodes specified in , depending on whether number of persistent huge pages is initially less than or greater than 20, respectively. No huge pages will be allocated nor freed on any node not included in the specified .h](hThis will allocate or free }(hj|hhhNhNubh)}(h``abs(20 - nr_hugepages)``h]habs(20 - nr_hugepages)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj|ubh to or from the nodes specified in , depending on whether number of persistent huge pages is initially less than or greater than 20, respectively. No huge pages will be allocated nor freed on any node not included in the specified .}(hj|hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM:hjhhubh)}(hWhen adjusting the persistent hugepage count via ``nr_hugepages_mempolicy``, any memory policy mode--bind, preferred, local or interleave--may be used. The resulting effect on persistent huge page allocation is as follows:h](h1When adjusting the persistent hugepage count via }(hjhhhNhNubh)}(h``nr_hugepages_mempolicy``h]hnr_hugepages_mempolicy}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, any memory policy mode--bind, preferred, local or interleave--may be used. The resulting effect on persistent huge page allocation is as follows:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM?hjhhubhenumerated_list)}(hhh](h list_item)}(hX\Regardless of mempolicy mode [see Documentation/admin-guide/mm/numa_memory_policy.rst], persistent huge pages will be distributed across the node or nodes specified in the mempolicy as if "interleave" had been specified. However, if a node in the policy does not contain sufficient contiguous memory for a huge page, the allocation will not "fallback" to the nearest neighbor node with sufficient contiguous memory. To do this would cause undesirable imbalance in the distribution of the huge page pool, or possibly, allocation of persistent huge pages on nodes not allowed by the task's memory policy. h]h)}(hX[Regardless of mempolicy mode [see Documentation/admin-guide/mm/numa_memory_policy.rst], persistent huge pages will be distributed across the node or nodes specified in the mempolicy as if "interleave" had been specified. However, if a node in the policy does not contain sufficient contiguous memory for a huge page, the allocation will not "fallback" to the nearest neighbor node with sufficient contiguous memory. To do this would cause undesirable imbalance in the distribution of the huge page pool, or possibly, allocation of persistent huge pages on nodes not allowed by the task's memory policy.h]hXeRegardless of mempolicy mode [see Documentation/admin-guide/mm/numa_memory_policy.rst], persistent huge pages will be distributed across the node or nodes specified in the mempolicy as if “interleave” had been specified. However, if a node in the policy does not contain sufficient contiguous memory for a huge page, the allocation will not “fallback” to the nearest neighbor node with sufficient contiguous memory. To do this would cause undesirable imbalance in the distribution of the huge page pool, or possibly, allocation of persistent huge pages on nodes not allowed by the task’s memory policy.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMChjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hXOne or more nodes may be specified with the bind or interleave policy. If more than one node is specified with the preferred policy, only the lowest numeric id will be used. Local policy will select the node where the task is running at the time the nodes_allowed mask is constructed. For local policy to be deterministic, the task must be bound to a cpu or cpus in a single node. Otherwise, the task could be migrated to some other node at any time after launch and the resulting node will be indeterminate. Thus, local policy is not very useful for this purpose. Any of the other mempolicy modes may be used to specify a single node. h]h)}(hX~One or more nodes may be specified with the bind or interleave policy. If more than one node is specified with the preferred policy, only the lowest numeric id will be used. Local policy will select the node where the task is running at the time the nodes_allowed mask is constructed. For local policy to be deterministic, the task must be bound to a cpu or cpus in a single node. Otherwise, the task could be migrated to some other node at any time after launch and the resulting node will be indeterminate. Thus, local policy is not very useful for this purpose. Any of the other mempolicy modes may be used to specify a single node.h]hX~One or more nodes may be specified with the bind or interleave policy. If more than one node is specified with the preferred policy, only the lowest numeric id will be used. Local policy will select the node where the task is running at the time the nodes_allowed mask is constructed. For local policy to be deterministic, the task must be bound to a cpu or cpus in a single node. Otherwise, the task could be migrated to some other node at any time after launch and the resulting node will be indeterminate. Thus, local policy is not very useful for this purpose. Any of the other mempolicy modes may be used to specify a single node.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMNhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hXThe nodes allowed mask will be derived from any non-default task mempolicy, whether this policy was set explicitly by the task itself or one of its ancestors, such as numactl. This means that if the task is invoked from a shell with non-default policy, that policy will be used. One can specify a node list of "all" with numactl --interleave or --membind [-m] to achieve interleaving over all nodes in the system or cpuset. h]h)}(hXThe nodes allowed mask will be derived from any non-default task mempolicy, whether this policy was set explicitly by the task itself or one of its ancestors, such as numactl. This means that if the task is invoked from a shell with non-default policy, that policy will be used. One can specify a node list of "all" with numactl --interleave or --membind [-m] to achieve interleaving over all nodes in the system or cpuset.h]hXThe nodes allowed mask will be derived from any non-default task mempolicy, whether this policy was set explicitly by the task itself or one of its ancestors, such as numactl. This means that if the task is invoked from a shell with non-default policy, that policy will be used. One can specify a node list of “all” with numactl --interleave or --membind [-m] to achieve interleaving over all nodes in the system or cpuset.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMXhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hXlAny task mempolicy specified--e.g., using numactl--will be constrained by the resource limits of any cpuset in which the task runs. Thus, there will be no way for a task with non-default policy running in a cpuset with a subset of the system nodes to allocate huge pages outside the cpuset without first moving to a cpuset that contains all of the desired nodes. h]h)}(hXkAny task mempolicy specified--e.g., using numactl--will be constrained by the resource limits of any cpuset in which the task runs. Thus, there will be no way for a task with non-default policy running in a cpuset with a subset of the system nodes to allocate huge pages outside the cpuset without first moving to a cpuset that contains all of the desired nodes.h]hXkAny task mempolicy specified--e.g., using numactl--will be constrained by the resource limits of any cpuset in which the task runs. Thus, there will be no way for a task with non-default policy running in a cpuset with a subset of the system nodes to allocate huge pages outside the cpuset without first moving to a cpuset that contains all of the desired nodes.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM_hj ubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h~Boot-time huge page allocation attempts to distribute the requested number of huge pages over all on-lines nodes with memory. h]h)}(h}Boot-time huge page allocation attempts to distribute the requested number of huge pages over all on-lines nodes with memory.h]h}Boot-time huge page allocation attempts to distribute the requested number of huge pages over all on-lines nodes with memory.}(hj' hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMehj# ubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix.uh1jhjhhhhhMCubeh}(h](Cinteraction-of-task-memory-policy-with-huge-page-allocation-freeingjeh ]h"](Cinteraction of task memory policy with huge page allocation/freeingmem_policy_and_hp_alloceh$]h&]uh1hhhhhhhhM'expect_referenced_by_name}jL jsexpect_referenced_by_id}jjsubh)}(hhh](h)}(hPer Node Hugepages Attributesh]hPer Node Hugepages Attributes}(hjV hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjS hhhhhMiubh)}(hA subset of the contents of the root huge page control directory in sysfs, described above, will be replicated under each the system device of each NUMA node with memory in::h]hA subset of the contents of the root huge page control directory in sysfs, described above, will be replicated under each the system device of each NUMA node with memory in:}(hjd hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMkhjS hhubj7)}(h./sys/devices/system/node/node[0-9]*/hugepages/h]h./sys/devices/system/node/node[0-9]*/hugepages/}hjr sbah}(h]h ]h"]h$]h&]jFjGuh1j6hhhMohjS hhubh)}(hqUnder this directory, the subdirectory for each supported huge page size contains the following attribute files::h]hpUnder this directory, the subdirectory for each supported huge page size contains the following attribute files:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMqhjS hhubj7)}(h-nr_hugepages free_hugepages surplus_hugepagesh]h-nr_hugepages free_hugepages surplus_hugepages}hj sbah}(h]h ]h"]h$]h&]jFjGuh1j6hhhMthjS hhubh)}(hThe free\_' and surplus\_' attribute files are read-only. They return the number of free and surplus [overcommitted] huge pages, respectively, on the parent node.h]hThe free_’ and surplus_’ attribute files are read-only. They return the number of free and surplus [overcommitted] huge pages, respectively, on the parent node.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMxhjS hhubh)}(hX6The ``nr_hugepages`` attribute returns the total number of huge pages on the specified node. When this attribute is written, the number of persistent huge pages on the parent node will be adjusted to the specified value, if sufficient resources exist, regardless of the task's mempolicy or cpuset constraints.h](hThe }(hj hhhNhNubh)}(h``nr_hugepages``h]h nr_hugepages}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubhX$ attribute returns the total number of huge pages on the specified node. When this attribute is written, the number of persistent huge pages on the parent node will be adjusted to the specified value, if sufficient resources exist, regardless of the task’s mempolicy or cpuset constraints.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM|hjS hhubh)}(hNote that the number of overcommit and reserve pages remain global quantities, as we don't know until fault time, when the faulting task's mempolicy is applied, from which node the huge page allocation will be attempted.h]hNote that the number of overcommit and reserve pages remain global quantities, as we don’t know until fault time, when the faulting task’s mempolicy is applied, from which node the huge page allocation will be attempted.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjS hhubh)}(hXThe hugetlb may be migrated between the per-node hugepages pool in the following scenarios: memory offline, memory failure, longterm pinning, syscalls(mbind, migrate_pages and move_pages), alloc_contig_range() and alloc_contig_pages(). Now only memory offline, memory failure and syscalls allow fallbacking to allocate a new hugetlb on a different node if the current node is unable to allocate during hugetlb migration, that means these 3 cases can break the per-node hugepages pool.h]hXThe hugetlb may be migrated between the per-node hugepages pool in the following scenarios: memory offline, memory failure, longterm pinning, syscalls(mbind, migrate_pages and move_pages), alloc_contig_range() and alloc_contig_pages(). Now only memory offline, memory failure and syscalls allow fallbacking to allocate a new hugetlb on a different node if the current node is unable to allocate during hugetlb migration, that means these 3 cases can break the per-node hugepages pool.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjS hhubj)}(h.. _using_huge_pages:h]h}(h]h ]h"]h$]h&]jusing-huge-pagesuh1jhMhjS hhhhubeh}(h]per-node-hugepages-attributesah ]h"]per node hugepages attributesah$]h&]uh1hhhhhhhhMiubh)}(hhh](h)}(hUsing Huge Pagesh]hUsing Huge Pages}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hIf the user applications are going to request huge pages using mmap system call, then it is required that system administrator mount a file system of type hugetlbfs::h]hIf the user applications are going to request huge pages using mmap system call, then it is required that system administrator mount a file system of type hugetlbfs:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj7)}(hmount -t hugetlbfs \ -o uid=,gid=,mode=,pagesize=,size=,\ min_size=,nr_inodes= none /mnt/hugeh]hmount -t hugetlbfs \ -o uid=,gid=,mode=,pagesize=,size=,\ min_size=,nr_inodes= none /mnt/huge}hj sbah}(h]h ]h"]h$]h&]jFjGuh1j6hhhMhj hhubh)}(hThis command mounts a (pseudo) filesystem of type hugetlbfs on the directory ``/mnt/huge``. Any file created on ``/mnt/huge`` uses huge pages.h](hMThis command mounts a (pseudo) filesystem of type hugetlbfs on the directory }(hj& hhhNhNubh)}(h ``/mnt/huge``h]h /mnt/huge}(hj. hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj& ubh. Any file created on }(hj& hhhNhNubh)}(h ``/mnt/huge``h]h /mnt/huge}(hj@ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj& ubh uses huge pages.}(hj& hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hThe ``uid`` and ``gid`` options sets the owner and group of the root of the file system. By default the ``uid`` and ``gid`` of the current process are taken.h](hThe }(hjX hhhNhNubh)}(h``uid``h]huid}(hj` hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjX ubh and }(hjX hhhNhNubh)}(h``gid``h]hgid}(hjr hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjX ubhR options sets the owner and group of the root of the file system. By default the }(hjX hhhNhNubh)}(h``uid``h]huid}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjX ubh and }hjX sbh)}(h``gid``h]hgid}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjX ubh" of the current process are taken.}(hjX hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hThe ``mode`` option sets the mode of root of file system to value & 01777. This value is given in octal. By default the value 0755 is picked.h](hThe }(hj hhhNhNubh)}(h``mode``h]hmode}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh option sets the mode of root of file system to value & 01777. This value is given in octal. By default the value 0755 is picked.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hXIf the platform supports multiple huge page sizes, the ``pagesize`` option can be used to specify the huge page size and associated pool. ``pagesize`` is specified in bytes. If ``pagesize`` is not specified the platform's default huge page size and associated pool will be used.=h](h7If the platform supports multiple huge page sizes, the }(hj hhhNhNubh)}(h ``pagesize``h]hpagesize}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubhG option can be used to specify the huge page size and associated pool. }(hj hhhNhNubh)}(h ``pagesize``h]hpagesize}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh is specified in bytes. If }(hj hhhNhNubh)}(h ``pagesize``h]hpagesize}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh[ is not specified the platform’s default huge page size and associated pool will be used.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hXThe ``size`` option sets the maximum value of memory (huge pages) allowed for that filesystem (``/mnt/huge``). The ``size`` option can be specified in bytes, or as a percentage of the specified huge page pool (``nr_hugepages``). The size is rounded down to HPAGE_SIZE boundary.h](hThe }(hj hhhNhNubh)}(h``size``h]hsize}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubhS option sets the maximum value of memory (huge pages) allowed for that filesystem (}(hj hhhNhNubh)}(h ``/mnt/huge``h]h /mnt/huge}(hj, hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh). The }(hj hhhNhNubh)}(h``size``h]hsize}(hj> hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubhW option can be specified in bytes, or as a percentage of the specified huge page pool (}(hj hhhNhNubh)}(h``nr_hugepages``h]h nr_hugepages}(hjP hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh3). The size is rounded down to HPAGE_SIZE boundary.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hX/The ``min_size`` option sets the minimum value of memory (huge pages) allowed for the filesystem. ``min_size`` can be specified in the same way as ``size``, either bytes or a percentage of the huge page pool. At mount time, the number of huge pages specified by ``min_size`` are reserved for use by the filesystem. If there are not enough free huge pages available, the mount will fail. As huge pages are allocated to the filesystem and freed, the reserve count is adjusted so that the sum of allocated and reserved huge pages is always at least ``min_size``.h](hThe }(hjh hhhNhNubh)}(h ``min_size``h]hmin_size}(hjp hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjh ubhR option sets the minimum value of memory (huge pages) allowed for the filesystem. }(hjh hhhNhNubh)}(h ``min_size``h]hmin_size}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjh ubh% can be specified in the same way as }(hjh hhhNhNubh)}(h``size``h]hsize}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjh ubhk, either bytes or a percentage of the huge page pool. At mount time, the number of huge pages specified by }(hjh hhhNhNubh)}(h ``min_size``h]hmin_size}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjh ubhX are reserved for use by the filesystem. If there are not enough free huge pages available, the mount will fail. As huge pages are allocated to the filesystem and freed, the reserve count is adjusted so that the sum of allocated and reserved huge pages is always at least }(hjh hhhNhNubh)}(h ``min_size``h]hmin_size}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjh ubh.}(hjh hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hVThe option ``nr_inodes`` sets the maximum number of inodes that ``/mnt/huge`` can use.h](h The option }(hj hhhNhNubh)}(h ``nr_inodes``h]h nr_inodes}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh( sets the maximum number of inodes that }(hj hhhNhNubh)}(h ``/mnt/huge``h]h /mnt/huge}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh can use.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hmIf the ``size``, ``min_size`` or ``nr_inodes`` option is not provided on command line then no limits are set.h](hIf the }(hj hhhNhNubh)}(h``size``h]hsize}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh, }(hj hhhNhNubh)}(h ``min_size``h]hmin_size}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh or }(hj hhhNhNubh)}(h ``nr_inodes``h]h nr_inodes}(hj. hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh? option is not provided on command line then no limits are set.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hFor ``pagesize``, ``size``, ``min_size`` and ``nr_inodes`` options, you can use [G|g]/[M|m]/[K|k] to represent giga/mega/kilo. For example, size=2K has the same meaning as size=2048.h](hFor }(hjF hhhNhNubh)}(h ``pagesize``h]hpagesize}(hjN hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjF ubh, }(hjF hhhNhNubh)}(h``size``h]hsize}(hj` hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjF ubh, }hjF sbh)}(h ``min_size``h]hmin_size}(hjr hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjF ubh and }(hjF hhhNhNubh)}(h ``nr_inodes``h]h nr_inodes}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjF ubh| options, you can use [G|g]/[M|m]/[K|k] to represent giga/mega/kilo. For example, size=2K has the same meaning as size=2048.}(hjF hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hoWhile read system calls are supported on files that reside on hugetlb file systems, write system calls are not.h]hoWhile read system calls are supported on files that reside on hugetlb file systems, write system calls are not.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(h{Regular chown, chgrp, and chmod commands (with right permissions) could be used to change the file attributes on hugetlbfs.h]h{Regular chown, chgrp, and chmod commands (with right permissions) could be used to change the file attributes on hugetlbfs.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hAlso, it is important to note that no such mount command is required if applications are going to use only shmat/shmget system calls or mmap with MAP_HUGETLB. For an example of how to use mmap with MAP_HUGETLB see :ref:`map_hugetlb ` below.h](hAlso, it is important to note that no such mount command is required if applications are going to use only shmat/shmget system calls or mmap with MAP_HUGETLB. For an example of how to use mmap with MAP_HUGETLB see }(hj hhhNhNubh)}(h :ref:`map_hugetlb `h]j*)}(hj h]h map_hugetlb}(hj hhhNhNubah}(h]h ](j5stdstd-refeh"]h$]h&]uh1j)hj ubah}(h]h ]h"]h$]h&]refdocjB refdomainj reftyperef refexplicitrefwarnjH map_hugetlbuh1hhhhMhj ubh below.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hX|Users who wish to use hugetlb memory via shared memory segment should be members of a supplementary group and system admin needs to configure that gid into ``/proc/sys/vm/hugetlb_shm_group``. It is possible for same or different applications to use any combination of mmaps and shm* calls, though the mount of filesystem will be required for using mmap calls without MAP_HUGETLB.h](hUsers who wish to use hugetlb memory via shared memory segment should be members of a supplementary group and system admin needs to configure that gid into }(hj hhhNhNubh)}(h"``/proc/sys/vm/hugetlb_shm_group``h]h/proc/sys/vm/hugetlb_shm_group}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh. It is possible for same or different applications to use any combination of mmaps and shm* calls, though the mount of filesystem will be required for using mmap calls without MAP_HUGETLB.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hX|Syscalls that operate on memory backed by hugetlb pages only have their lengths aligned to the native page size of the processor; they will normally fail with errno set to EINVAL or exclude hugetlb pages that extend beyond the length if not hugepage aligned. For example, munmap(2) will fail if memory is backed by a hugetlb page and the length is smaller than the hugepage size.h]hX|Syscalls that operate on memory backed by hugetlb pages only have their lengths aligned to the native page size of the processor; they will normally fail with errno set to EINVAL or exclude hugetlb pages that extend beyond the length if not hugepage aligned. For example, munmap(2) will fail if memory is backed by a hugetlb page and the length is smaller than the hugepage size.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubeh}(h](j id1eh ]h"](using huge pagesusing_huge_pageseh$]h&]uh1hhhhhhhhMjO }j j sjQ }j j subh)}(hhh](h)}(hExamplesh]hExamples}(hj& hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj# hhhhhMubj)}(h.. _map_hugetlb:h]h}(h]h ]h"]h$]h&]j map-hugetlbuh1jhMhj# hhhhubjW)}(hhh](j\)}(h=``map_hugetlb`` see tools/testing/selftests/mm/map_hugetlb.c h](jb)}(h``map_hugetlb``h]h)}(hjH h]h map_hugetlb}(hjJ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjF ubah}(h]h ]h"]h$]h&]uh1jahhhMhjB ubjr)}(hhh]h)}(h,see tools/testing/selftests/mm/map_hugetlb.ch]h,see tools/testing/selftests/mm/map_hugetlb.c}(hj` hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj] ubah}(h]h ]h"]h$]h&]uh1jqhjB ubeh}(h]h ]h"]h$]h&]uh1j[hhhMhj? ubj\)}(h?``hugepage-shm`` see tools/testing/selftests/mm/hugepage-shm.c h](jb)}(h``hugepage-shm``h]h)}(hj h]h hugepage-shm}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj~ ubah}(h]h ]h"]h$]h&]uh1jahhhMhjz ubjr)}(hhh]h)}(h-see tools/testing/selftests/mm/hugepage-shm.ch]h-see tools/testing/selftests/mm/hugepage-shm.c}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jqhjz ubeh}(h]h ]h"]h$]h&]uh1j[hhhMhj? hhubj\)}(hA``hugepage-mmap`` see tools/testing/selftests/mm/hugepage-mmap.c h](jb)}(h``hugepage-mmap``h]h)}(hj h]h hugepage-mmap}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1jahhhMhj ubjr)}(hhh]h)}(h.see tools/testing/selftests/mm/hugepage-mmap.ch]h.see tools/testing/selftests/mm/hugepage-mmap.c}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jqhj ubeh}(h]h ]h"]h$]h&]uh1j[hhhMhj? hhubeh}(h]j> ah ]h"] map_hugetlbah$]h&]uh1jVhj# hhhhhNjO }j j4 sjQ }j> j4 subh)}(hThe `libhugetlbfs`_ library provides a wide range of userspace tools to help with huge page usability, environment setup, and control.h](hThe }(hj hhhNhNubh reference)}(h`libhugetlbfs`_h]h libhugetlbfs}(hj hhhNhNubah}(h]h ]h"]h$]h&]name libhugetlbfsrefuri,https://github.com/libhugetlbfs/libhugetlbfsuh1j hj resolvedKubht library provides a wide range of userspace tools to help with huge page usability, environment setup, and control.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj# hhubj)}(h>.. _libhugetlbfs: https://github.com/libhugetlbfs/libhugetlbfsh]h}(h] libhugetlbfsah ]h"] libhugetlbfsah$]h&]j juh1jhMhj# hhhh referencedKubeh}(h]examplesah ]h"]examplesah$]h&]uh1hhhhhhhhMubeh}(h] hugetlb-pagesah ]h"] hugetlb pagesah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjZerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames} libhugetlbfs]j asrefids}(j]jaj ]j aj> ]j4 aunameids}(j4j1jjjL jjK jH j j j j j j j,j)j j> j#j u nametypes}(j4jjL jK j j j j,j j#uh}(j1hjhjjjH jj jS j j j j j)j# j> j? j ju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}jhKsRparse_messages]transform_messages](hsystem_message)}(hhh]h)}(hhh]h=Hyperlink target "mem-policy-and-hp-alloc" is not referenced.}hjsbah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineM$uh1jubj)}(hhh]h)}(hhh]h6Hyperlink target "using-huge-pages" is not referenced.}hjsbah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]levelKtypejsourcehlineMuh1jubj)}(hhh]h)}(hhh]h1Hyperlink target "map-hugetlb" is not referenced.}hjsbah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]levelKtypejsourcehlineMuh1jube transformerN include_log] decorationNhhub.