Skip to content

Commit 189cdb3

Browse files
authored
Merge pull request #43537 from profnandaa/enhancement/huge-pages-docs
hugepages: add some details on allocation
2 parents 3290b9b + ca2b302 commit 189cdb3

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

content/en/docs/tasks/manage-hugepages/scheduling-hugepages.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,45 @@ by applications in a Pod. This page describes how users can consume huge pages.
1414

1515
## {{% heading "prerequisites" %}}
1616

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

18-
1. Kubernetes nodes must pre-allocate huge pages in order for the node to report
19-
its huge page capacity. A node can pre-allocate huge pages for multiple
20-
sizes.
21+
A node can pre-allocate huge pages for multiple sizes, for instance,
22+
the following line in `/etc/default/grub` allocates `2*1GiB` of 1 GiB
23+
and `512*2 MiB` of 2 MiB pages:
24+
25+
```
26+
GRUB_CMDLINE_LINUX="hugepagesz=1G hugepages=2 hugepagesz=2M hugepages=512"
27+
```
2128

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

32+
When you describe the Node, you should see something similar to the following
33+
in the following in the `Capacity` and `Allocatable` sections:
34+
35+
```
36+
Capacity:
37+
cpu: ...
38+
ephemeral-storage: ...
39+
hugepages-1Gi: 2Gi
40+
hugepages-2Mi: 1Gi
41+
memory: ...
42+
pods: ...
43+
Allocatable:
44+
cpu: ...
45+
ephemeral-storage: ...
46+
hugepages-1Gi: 2Gi
47+
hugepages-2Mi: 1Gi
48+
memory: ...
49+
pods: ...
50+
```
2551

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

2757
<!-- steps -->
2858

0 commit comments

Comments
 (0)