Skip to content

Commit 6f3dd3d

Browse files
authored
Merge pull request #51068 from jmencak/4.12-thp
OCPBUGS-1849: Move section about disabling Transparent Huge Pages
2 parents d87345b + c75b2cd commit 6f3dd3d

File tree

4 files changed

+72
-73
lines changed

4 files changed

+72
-73
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * scalability_and_performance/what-huge-pages-do-and-how-they-are-consumed-by-apps.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="disable-thp_{context}"]
7+
= Disabling Transparent Huge Pages
8+
9+
Transparent Huge Pages (THP) attempt to automate most aspects of creating, managing, and using huge pages. Since THP automatically manages the huge pages, this is not always handled optimally for all types of workloads. THP can lead to performance regressions, since many applications handle huge pages on their own. Therefore, consider disabling THP. The following steps describe how to disable THP using the Node Tuning Operator (NTO).
10+
11+
.Procedure
12+
13+
. Create a file with the following content and name it `thp-disable-tuned.yaml`:
14+
+
15+
[source,yaml]
16+
----
17+
apiVersion: tuned.openshift.io/v1
18+
kind: Tuned
19+
metadata:
20+
name: thp-workers-profile
21+
namespace: openshift-cluster-node-tuning-operator
22+
spec:
23+
profile:
24+
- data: |
25+
[main]
26+
summary=Custom tuned profile for OpenShift to turn off THP on worker nodes
27+
include=openshift-node
28+
29+
[vm]
30+
transparent_hugepages=never
31+
name: openshift-thp-never-worker
32+
33+
recommend:
34+
- match:
35+
- label: node-role.kubernetes.io/worker
36+
priority: 25
37+
profile: openshift-thp-never-worker
38+
----
39+
40+
. Create the Tuned object:
41+
+
42+
[source,terminal]
43+
----
44+
$ oc create -f thp-disable-tuned.yaml
45+
----
46+
47+
. Check the list of active profiles:
48+
+
49+
[source,terminal]
50+
----
51+
$ oc get profile -n openshift-cluster-node-tuning-operator
52+
----
53+
54+
.Verification
55+
56+
* Log in to one of the nodes and do a regular THP check to verify if the nodes applied the profile successfully:
57+
+
58+
[source,terminal]
59+
----
60+
$ cat /sys/kernel/mm/transparent_hugepage/enabled
61+
----
62+
+
63+
.Example output
64+
[source,terminal]
65+
----
66+
always madvise [never]
67+
----

modules/how-huge-pages-are-consumed-by-apps.adoc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,3 @@ than the pod request.
7171

7272
* Applications that consume huge pages via `shmget()` with `SHM_HUGETLB` must run
7373
with a supplemental group that matches *_proc/sys/vm/hugetlb_shm_group_*.
74-
75-
[role="_additional-resources"]
76-
.Additional resources
77-
78-
* link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/performance_tuning_guide/sect-red_hat_enterprise_linux-performance_tuning_guide-configuring_transparent_huge_pages[Configuring Transparent Huge Pages]

modules/ibm-z-disable-thp.adoc

Lines changed: 3 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -2,73 +2,8 @@
22
//
33
// * scalability_and_performance/ibm-z-recommended-host-practices.adoc
44

5-
:_content-type: PROCEDURE
5+
:_content-type: CONCEPT
66
[id="ibm-z-disable-thp_{context}"]
7-
= How to disable Transparent Huge Pages
8-
9-
Transparent Huge Pages (THP) attempt to automate most aspects of creating, managing, and using huge pages. Since THP automatically manages the huge pages, this is not always handled optimally for all types of workloads. THP can lead to performance regressions, since many applications handle huge pages on their own. Therefore, consider disabling THP. The following steps describe how to disable THP using a Node Tuning Operator (NTO) profile.
10-
11-
[id="disable-thp-with-a-nto-profile_{context}"]
12-
== Disable THP with a Node Tuning Operator (NTO) profile
13-
14-
.Procedure
15-
16-
. Copy the following NTO sample profile into a YAML file. For example, `thp-s390-tuned.yaml`:
17-
+
18-
[source,yaml]
19-
----
20-
apiVersion: tuned.openshift.io/v1
21-
kind: Tuned
22-
metadata:
23-
name: thp-workers-profile
24-
namespace: openshift-cluster-node-tuning-operator
25-
spec:
26-
profile:
27-
- data: |
28-
[main]
29-
summary=Custom tuned profile for OpenShift on IBM Z to turn off THP on worker nodes
30-
include=openshift-node
31-
32-
[vm]
33-
transparent_hugepages=never
34-
name: openshift-thp-never-worker
35-
36-
recommend:
37-
- match:
38-
- label: node-role.kubernetes.io/worker
39-
priority: 35
40-
profile: openshift-thp-never-worker
41-
----
42-
43-
. Create the NTO profile:
44-
+
45-
[source,terminal]
46-
----
47-
$ oc create -f thp-s390-tuned.yaml
48-
----
49-
50-
. Check the list of active profiles:
51-
+
52-
[source,terminal]
53-
----
54-
$ oc get tuned -n openshift-cluster-node-tuning-operator
55-
----
56-
57-
. Remove the profile:
58-
+
59-
[source,terminal]
60-
----
61-
$ oc delete -f thp-s390-tuned.yaml
62-
----
63-
64-
.Verification
65-
66-
* Log in to one of the nodes and do a regular THP check to verify if the nodes applied the profile successfully:
67-
+
68-
[source,terminal]
69-
----
70-
$ cat /sys/kernel/mm/transparent_hugepage/enabled
71-
always madvise [never]
72-
----
73-
7+
= Disable Transparent Huge Pages
748

9+
Transparent Huge Pages (THP) attempt to automate most aspects of creating, managing, and using huge pages. Since THP automatically manages the huge pages, this is not always handled optimally for all types of workloads. THP can lead to performance regressions, since many applications handle huge pages on their own. Therefore, consider disabling THP.

scalability_and_performance/what-huge-pages-do-and-how-they-are-consumed-by-apps.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ include::modules/consuming-huge-pages-resource-using-the-downward-api.adoc[level
1818
* xref:../nodes/containers/nodes-containers-downward-api.adoc#nodes-containers-downward-api[Allowing containers to consume Downward API objects]
1919
2020
include::modules/configuring-huge-pages.adoc[leveloffset=+1]
21+
22+
include::modules/disabling-transparent-huge-pages.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)