Skip to content

feat: add hugepages support#4864

Draft
piyush-jena wants to merge 3 commits into
bottlerocket-os:developfrom
piyush-jena:hugepages-final
Draft

feat: add hugepages support#4864
piyush-jena wants to merge 3 commits into
bottlerocket-os:developfrom
piyush-jena:hugepages-final

Conversation

@piyush-jena

@piyush-jena piyush-jena commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Closes #

Description of changes:

  • Add support for hugepages

Testing done:
Set the following settings:

[ssm-user@control]$ apiclient apply  <<EOF
[settings.kernel.hugepages."2Mi"]
> count = 200
> [settings.kernel.hugepages."1Gi"]
> count = 2
> EOF
[ssm-user@control]$ apiclient get settings.kernel.hugepages
{
  "settings": {
    "kernel": {
      "hugepages": {
        "1Gi": {
          "count": 2
        },
        "2Mi": {
          "count": 200
        }
      }
    }
  }
}
[ssm-user@control]$ cat /proc/meminfo | grep ^Huge
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:               0 kB

The hugepages are not allocated yet because we have set it up to allocate only at boot.

Post reboot:

  1. Meminfo output:
bash-5.2# cat /proc/meminfo | grep ^Huge
HugePages_Total:     200
HugePages_Free:      200
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:         2506752 kB

200 hugepages of default size has been allocated. Hugetlb size = 2048200 + 10485762 = 2506752 kB

  1. Describe node output
    $ kubectl describe node --kubeconfig bottlerocket-cluster-134.kubeconfig
    [Output trimmed for brevity]
Capacity:
  cpu:                128
  ephemeral-storage:  20100288Ki
  hugepages-1Gi:      2Gi
  hugepages-2Mi:      400Mi
  memory:             259892560Ki
  pods:               737
Allocatable:
  cpu:                127610m
  ephemeral-storage:  17450683567
  hugepages-1Gi:      2Gi
  hugepages-2Mi:      400Mi
  memory:             248720720Ki
  pods:               737

As we can see the hugepages show up as allocatable resources.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@piyush-jena piyush-jena force-pushed the hugepages-final branch 4 times, most recently from df10776 to eb46523 Compare June 24, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant