Inspect and manage Linux hugepages
Project description
hugepages
hugepages is a small CLI for inspecting and configuring the Linux
hugepage pool. It reports current totals, free, and reserved counts per
supported page size, reserves pages via the sysfs interface at
/sys/kernel/mm/hugepages/, and mounts the hugetlbfs filesystem
(default /dev/hugepages).
Install
pipx install hugepages
Or standalone (single-file, stdlib only, no pip needed):
curl -fsSL https://raw.githubusercontent.com/xnvme/hugepages/main/src/hugepages/hugepages.py \
-o ~/.local/bin/hugepages && chmod +x ~/.local/bin/hugepages
Shell completion
hugepages --print-completion bash > ~/.local/share/bash-completion/completions/hugepages
Open a new shell (or source the file) and tab-completion is live: hugepages <TAB> lists info setup mount.
Usage
$ hugepages --help
usage: hugepages [-h] [--version] [--verbose] [--print-completion SHELL]
{info,setup,mount} ...
Inspect and manage Linux hugepages
positional arguments:
{info,setup,mount}
info Show hugepage status and capabilities
setup Configure hugepage pool
mount Mount hugetlbfs
options:
-h, --help show this help message and exit
--version show program's version number and exit
--verbose Enable verbose logging
--print-completion SHELL
Print shell completion script to stdout and exit
A few common invocations:
hugepages info # current pool state + supported sizes
sudo hugepages setup --count 512 # reserve 512 pages at the smallest supported size
sudo hugepages setup --size 2048 --count 1024 # reserve 1024 x 2 MiB (explicit size)
sudo hugepages mount # mount hugetlbfs at /dev/hugepages
1 GiB hugepages are only available if the kernel was booted with
default_hugepagesz=1G hugepagesz=1G hugepages=N on the cmdline; the
kernel reserves the 1 GiB pool at boot, and hugepages setup cannot
enable that size after the fact. hugepages info lists the sizes the
running kernel actually supports.
hugepages info sample output (pool not yet reserved):
Hugepage Support:
Size: 2048kB Total: 0 Free: 0 Reserved: 0
Size: 1048576kB Total: 0 Free: 0 Reserved: 0
Allocation paths
hugepages setup reserves pages in the kernel pool. Programs that
allocate via memfd_create(..., MFD_HUGETLB) or
mmap(..., MAP_HUGETLB) draw directly from the pool; no filesystem is
needed. Modern DPDK and custom xNVMe/uPCIe code take this path.
hugepages mount additionally mounts the hugetlbfs pseudo-filesystem
(default /dev/hugepages). Programs that want file-backed hugepages
with named-page semantics open and mmap files under the mountpoint.
SPDK and classic DPDK with --huge-dir use this path.
Related
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hugepages-0.2.10.tar.gz.
File metadata
- Download URL: hugepages-0.2.10.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ccbb8991f9cec321289abedc1b7f5632519f4f179face32e1d9c54f7d8112e0
|
|
| MD5 |
024b012b8489a012e3a2f1cf1c2e5001
|
|
| BLAKE2b-256 |
bd7262f19f09a988ff4db143f490039d28a5b79a84f61199c4d75ecf059fafaa
|
Provenance
The following attestation bundles were made for hugepages-0.2.10.tar.gz:
Publisher:
publish.yml on xnvme/hugepages
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hugepages-0.2.10.tar.gz -
Subject digest:
6ccbb8991f9cec321289abedc1b7f5632519f4f179face32e1d9c54f7d8112e0 - Sigstore transparency entry: 1535481679
- Sigstore integration time:
-
Permalink:
xnvme/hugepages@6d3094e1c3889b147b0c12da497707afcc1379f9 -
Branch / Tag:
refs/tags/v0.2.10 - Owner: https://github.com/xnvme
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6d3094e1c3889b147b0c12da497707afcc1379f9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hugepages-0.2.10-py3-none-any.whl.
File metadata
- Download URL: hugepages-0.2.10-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
735c345a81ad10e9fb3e98486dcfc74760decaf1028307a15729304db0beacd6
|
|
| MD5 |
c48649f5cb690329b31dc7f75fb31819
|
|
| BLAKE2b-256 |
8c03a99400ecc6c40aafafa7dbb875700092ab5eda773e7412c87f3800c300da
|
Provenance
The following attestation bundles were made for hugepages-0.2.10-py3-none-any.whl:
Publisher:
publish.yml on xnvme/hugepages
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hugepages-0.2.10-py3-none-any.whl -
Subject digest:
735c345a81ad10e9fb3e98486dcfc74760decaf1028307a15729304db0beacd6 - Sigstore transparency entry: 1535481766
- Sigstore integration time:
-
Permalink:
xnvme/hugepages@6d3094e1c3889b147b0c12da497707afcc1379f9 -
Branch / Tag:
refs/tags/v0.2.10 - Owner: https://github.com/xnvme
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6d3094e1c3889b147b0c12da497707afcc1379f9 -
Trigger Event:
push
-
Statement type: