Skip to main content

Inspect and manage Linux hugepages

Project description

hugepages: inspect and manage Linux hugepages

hugepages

PyPI Python Test

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 1048576 --count 4   # reserve 4 x 1 GiB pages
sudo hugepages mount                            # mount hugetlbfs at /dev/hugepages

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

Related

  • devbind: inspect and control PCI device-driver binding in Linux.
  • iommu: inspect and configure the IOMMU in Linux.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hugepages-0.2.9.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hugepages-0.2.9-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file hugepages-0.2.9.tar.gz.

File metadata

  • Download URL: hugepages-0.2.9.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hugepages-0.2.9.tar.gz
Algorithm Hash digest
SHA256 a9a9b101752769d91fcdac50ce60b000f24be106e5de081f940abb04689c2545
MD5 b663c1f490c6063addfce0b96d97d3a6
BLAKE2b-256 3304c5ff4bcbac9a560c3855488ba7961dd8516d601e9f3447eed22d60fe4da4

See more details on using hashes here.

Provenance

The following attestation bundles were made for hugepages-0.2.9.tar.gz:

Publisher: publish.yml on xnvme/hugepages

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hugepages-0.2.9-py3-none-any.whl.

File metadata

  • Download URL: hugepages-0.2.9-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hugepages-0.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c5da8ca1fd7f69e29b889e28d02d95e01bd173259d55ef1626c3052581f38980
MD5 716977c930673658530785934a872cfe
BLAKE2b-256 fa18e5a3b61c335103bb6cbb9db7d7feed8a04164b292471878a161439075a51

See more details on using hashes here.

Provenance

The following attestation bundles were made for hugepages-0.2.9-py3-none-any.whl:

Publisher: publish.yml on xnvme/hugepages

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page