HUGEADM(8)
๐ HUGEADM ๐
okay bestie, so this is hugeadm, and it lives in section 8 of the System Manager's Manual. it's a system-admin girlie, not a user-space one, so you already know it means business. ๐ซถ
โจ NAME โจ
hugeadm โ configure the system huge page pools ๐โจ
like. it sets up your huge pages. the big ones. the main character pages. ๐
โจ SYNOPSIS โจ
hugeadm [options]
that's it. that's the whole vibe. you run hugeadm and then you hand it some options and it does its thing. no positional args, no drama, just options. ๐ธ
ngl there's a LOT more coming โ this is just the opening act and she has range. stay tuned bestie ๐
๐ DESCRIPTION ๐
okay so bestie, hugeadm is literally the main character of huge page management. it displays and configures the system's huge page pools, and the way it works is so iconic: each pool has a minimum and a maximum threshold, like a little range of vibes. ๐
the minimum value gets allocated up front by the kernel and is guaranteed to stay as hugepages until you shrink the pool. periodt. so if you set a minimum, those pages are yours, no takebacks (unless you shrink).
if you set a maximum, the system will dynamically allocate pages whenever applications ask for more hugepages than the minimum size of the pool. but โ and this is the important part, ngl โ there is no guarantee that more pages than this minimum pool size can be allocated. so don't come for the kernel if it can't deliver. ๐
๐ Options that create hugetlbfs mount points ๐
these next ones literally create mounts for you. it's giving convenience.
--create-mountsโ creates mount points for each supported huge page size under/var/lib/hugetlbfs. after creation they are mounts and are owned byroot:rootwith permissions set to770. each mount point is namedpagesize-<size in bytes>. ๐ซถ--create-user-mounts=<user>โ creates mount points for each supported huge page size under/var/lib/hugetlbfs/user/<user>. the naming is the same as--create-mounts. after creation they are mounted and are owned by<user>:rootwith permissions set to700. ๐--create-group-mounts=<group>โ creates mount points for each supported huge page size under/var/lib/hugetlbfs/group/<group>. naming? same as--create-mounts. after creation they are mounted and are owned byroot:<group>with permissions set to070. ๐ธ--create-global-mountsโ creates mount points for each supported huge page size under/var/lib/hugetlbfs/global. yep, naming is the same as--create-mountsagain. after creation they are mounted and are owned byroot:rootwith permissions set to1777. (that sticky bit is doing WORK, slay.) ๐
โจ Options that affect how mount points are created โจ
--max-sizeโ used in conjunction with--create-*-mounts. it limits the maximum amount of memory used by files within the mount point, rounded up to the nearest huge page size. this can be used, for example, to grant different huge page quotas to individual users or groups. it's giving quota queen. ๐--max-inodesโ also used in conjunction with--create-*-mounts. it limits the number of inodes (e.g. files) that can be created on the new mount points. this limits the number of mappings that can be created on a mount point. it could be used, for example, to limit the number of application instances that used a mount point, as long as it was known how many inodes each application instance required. math girlies stay winning. ๐งฎ
๐ฆ Options that display information about the pools ๐ฆ
--pool-listโ this displays the Minimum, Current and Maximum number of huge pages in the pool for each pagesize supported by the system. let me break it down fr fr:- the "Minimum" value is the size of the static pool, and there will always be at least this number of hugepages in use by the system โ either by applications or kept by the kernel in a reserved pool.
- the "Current" value is the number of hugepages currently in use, either by applications or stored on the kernel's free list.
- the "Maximum" value is the largest number of hugepages that can be in use at any given time.
--set-recommended-min_free_kbytesโ fragmentation avoidance in the kernel depends on avoiding pages of different mobility types being mixed with a pageblock arena โ typically the size of the default huge page size. the more mixing that occurs, the less likely the huge page pool will be able to dynamically resize. the easiest means of avoiding mixing is to increase/proc/sys/vm/min_free_kbytes. this parameter setsmin_free_kbytesto a recommended value to aid fragmentation avoidance. no cap, this one's actually important. ๐ฅ--set-recommended-shmmaxโ the maximum shared memory segment size should be set to at least the size of the largest shared memory segment size you want available for applications using huge pages, via/proc/sys/kernel/shmmax. optionally, it can be set automatically to match the maximum possible size of all huge page allocations โ and thus the maximum possible shared memory segment size โ using this switch. โจ--set-shm-group=<gid|groupname>โ users in the group specified in/proc/sys/vm/hugetlb_shm_groupare granted full access to huge pages. the sysctl takes a numeric gid, but this hugeadm option can set it for you, using either a gid or a group name. so flexible, we love her. ๐--page-sizesโ displays every page size supported by the system and has a pool configured. ๐--page-sizes-allโ displays all page sizes supported by the system, even if no pool is available. completionist energy. โญ--list-all-mountsโ displays all active mount points for hugetlbfs. ๐
๐ง Options that configure the pool ๐ง
--pool-pages-min=<size|DEFAULT>:[+|-]<pagecount|memsize<G|M|K>>โ this option sets or adjusts the Minimum number of hugepages in the pool for pagesize size. size may be specified in bytes, or in kilobytes, megabytes, or gigabytes by appendingK,M, orGrespectively, or asDEFAULT, which uses the system's default huge page size for size. the pool size adjustment can be specified by pagecount pages, or by memsize if postfixed withG,M, orKfor gigabytes, megabytes, or kilobytes respectively. if the adjustment is specified via memsize, then the pagecount will be calculated for you, based on page size size. the pool is set to pagecount pages if+or-are not specified; if+or-are specified, then the size of the pool will adjust by that amount.
โ ๏ธ note that there is no guarantee that the system can allocate the hugepages requested for the Minimum pool. the size of the pools should be checked after executing this command to ensure they were successful. bestie, please check. i'm begging. ๐ญ
--obey-numa-mempolโ this option requests that allocation of huge pages to the static pool with--pool-pages-minobey the NUMA memory policy of the current process. this policy can be explicitly specified usingnumactlor inherited from a parent process. inherited trauma but for memory policy ๐ซถ--pool-pages-max=<size|DEFAULT>:[+|-]<pagecount|memsize<G|M|K>>โ this option sets or adjusts the Maximum number of hugepages. note that while the Minimum number of pages are guaranteed to be available to applications, there is not a guarantee that the system can allocate the pages on demand when the number of huge pages requested by applications is between the Minimum and Maximum pool sizes. see--pool-pages-minfor usage syntax. same syntax, different vibes. ๐--enable-zone-movableโ this option enables the use of theMOVABLEzone for the allocation of hugepages. this zone is created whenkernelcore=ormovablecore=are specified on the kernel command line, but the zone is not used for the allocation of huge pages by default, as the intended use for the zone may be to guarantee that memory can be off-lined and hot-removed. the kernel guarantees that the pages within this zone can be reclaimed, unlike some kernel buffers for example. unless pages are locked withmlock(), the hugepage pool can grow to at least the size of the movable zone once this option is set. use sysctl to permanently enable the use of theMOVABLEzone for the allocation of huge pages. ๐ฅ--disable-zone-movableโ this option disables the use of theMOVABLEzone for the future allocation of huge pages. note that existing huge pages are not reclaimed from the zone. use sysctl to permanently disable the use of theMOVABLEzone for the allocation of huge pages. bye bye movable zone (eventually). ๐--hardโ this option is specified with--pool-pages-minto retry allocations multiple times on failure to allocate the desired count of pages. it initially tries to resize the pool up to 5 times, and continues to try if progress is being made towards the resize. she's persistent, we stan. ๐ช--add-temp-swap<=count>โ this option is specified with--pool-pages-minto initialize a temporary swap file for the duration of the pool resize. when increasing the size of the pool, it can be necessary to reclaim pages so that contiguous memory is freed, and this often requires swap to be successful. swap is only created for a positive resize, and is then removed once the resize operation is completed. the default swap size is 5 huge pages; the optional argument<count>sets the swap size to<count>huge pages. โจ--add-ramdisk-swapโ this option is specified with--pool-pages-minto initialize swap in memory on ram disks. when increasing the size of the pool, it can be necessary to reclaim pages so that contiguous memory is freed, and this often requires swap to be successful. if there isn't enough free disk space, swap can be initialized in RAM using this option. if the size of one ramdisk is not greater than the huge page size, then swap is initialized on multiple ramdisks. swap is only created for a positive resize, and by default is removed once the resize operation is completed. ramdisk girlies rise up ๐ง--persistโ this option is specified with--add-temp-swapor--add-ramdisk-swapto make the swap space persist after the resize operation is completed. the swap spaces can later be removed manually using theswapoffcommand. you've been warned, it stays. ๐ซถ
๐ Options that tune transparent huge page usage ๐
--thp-alwaysโ enable transparent huge pages always. โจ--thp-madviseโ enable transparent huge pages only on madvised regions. ๐--thp-neverโ disable transparent huge pages. periodt. ๐ซ--thp-khugepaged-pages <pages to scan>โ configure the number of pages thatkhugepagedshould scan on each pass. ๐--thp-khugepaged-scan-sleep <milliseconds>โ configure how many millisecondskhugepagedshould wait between passes. ๐ค--thp-khugepaged-alloc-sleep <milliseconds>โ configure how many millisecondskhugepagedshould wait after failing to allocate a huge page, to throttle the next attempt. ๐ฎโ๐จ
๐ฌ Options that affect the verbosity of libhugetlbfs ๐ฌ
--verbose <level>,-vโ the default value for the verbosity level is 1, and the range of the value can be set with--verbosefrom 0 to 99. the higher the value, the more verbose the library will be.0is quiet, and3will output much debugging information. the verbosity level is increased by one each time-vis specified. so-vvvis just... a lot of talking. iconic. ๐ฃ๏ธ
๐ SEE ALSO ๐
okay so if you're nosy (love that for you) and you wanna go read the other pages in this little family, here's the whole squad:
go forth and read, bestie, they're all part of the same friend group ๐ซถ
๐ธ AUTHORS ๐ธ
so likeโฆ who even made this? libhugetlbfs was written by various people on the libhugetlbfs-devel mailing list. it's giving collaborative slay, it's giving community effort, no single main character here โ just a whole group chat of legends โจ๐
and that's the whole page, babe, you made it to the end ๐ this one's from October 1, 2009, and it's page HUGEADM(8) โ go hug a huge page for me ๐ ๐ฆ
๐ฆ where this page comes from
- debian bookworm: libhugetlbfs-bin 2.23-5 ยท LGPL-2.1-only
- debian trixie: libhugetlbfs-bin 2.24-1+b1 ยท LGPL-2.1-only
- nixpkgs unstable: libhugetlbfs 2.24
- opensuse-leap 16.0: libhugetlbfs 2.24.0.g1322884-160000.3.2 ยท LGPL-2.1-or-later
- opensuse-leap 16.0: libhugetlbfs 2.24.0.g1322884-160000.3.2 ยท LGPL-2.1-or-later
- opensuse-leap 16.0: libhugetlbfs 2.24.0.g1322884-160000.3.2 ยท LGPL-2.1-or-later
- opensuse-leap 16.0: libhugetlbfs 2.24.0.g1322884-160000.3.2 ยท LGPL-2.1-or-later
- ubuntu jammy: libhugetlbfs-bin 2.23-4 ยท LGPL-2.1-only
- ubuntu noble: libhugetlbfs-bin 2.23-5build1 ยท LGPL-2.1-only
- ubuntu questing: libhugetlbfs-bin 2.24-1
- ubuntu resolute: libhugetlbfs-bin 2.24-1build1 ยท LGPL-2.1-only
- ubuntu stonking: libhugetlbfs-bin 2.24-1build1 ยท LGPL-2.1-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms