Skip to content

Commit

Permalink
Merge pull request #43537 from profnandaa/enhancement/huge-pages-docs
Browse files Browse the repository at this point in the history
hugepages: add some details on allocation
  • Loading branch information
k8s-ci-robot authored Oct 24, 2023
2 parents 3290b9b + ca2b302 commit 189cdb3
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions content/en/docs/tasks/manage-hugepages/scheduling-hugepages.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,45 @@ by applications in a Pod. This page describes how users can consume huge pages.

## {{% heading "prerequisites" %}}

Kubernetes nodes must
[pre-allocate huge pages](https://www.kernel.org/doc/html/latest/admin-guide/mm/hugetlbpage.html)
in order for the node to report its huge page capacity.

1. Kubernetes nodes must pre-allocate huge pages in order for the node to report
its huge page capacity. A node can pre-allocate huge pages for multiple
sizes.
A node can pre-allocate huge pages for multiple sizes, for instance,
the following line in `/etc/default/grub` allocates `2*1GiB` of 1 GiB
and `512*2 MiB` of 2 MiB pages:

```
GRUB_CMDLINE_LINUX="hugepagesz=1G hugepages=2 hugepagesz=2M hugepages=512"
```

The nodes will automatically discover and report all huge page resources as
schedulable resources.

When you describe the Node, you should see something similar to the following
in the following in the `Capacity` and `Allocatable` sections:

```
Capacity:
cpu: ...
ephemeral-storage: ...
hugepages-1Gi: 2Gi
hugepages-2Mi: 1Gi
memory: ...
pods: ...
Allocatable:
cpu: ...
ephemeral-storage: ...
hugepages-1Gi: 2Gi
hugepages-2Mi: 1Gi
memory: ...
pods: ...
```

{{< note >}}
For dynamically allocated pages (after boot), the Kubelet needs to be restarted
for the new allocations to be refrelected.
{{< /note >}}

<!-- steps -->

Expand Down

0 comments on commit 189cdb3

Please sign in to comment.