@@ -107,7 +107,7 @@ sysfs
107
107
Global THP controls
108
108
-------------------
109
109
110
- Transparent Hugepage Support for anonymous memory can be entirely disabled
110
+ Transparent Hugepage Support for anonymous memory can be disabled
111
111
(mostly for debugging purposes) or only enabled inside MADV_HUGEPAGE
112
112
regions (to avoid the risk of consuming more memory resources) or enabled
113
113
system wide. This can be achieved per-supported-THP-size with one of::
@@ -119,6 +119,11 @@ system wide. This can be achieved per-supported-THP-size with one of::
119
119
where <size> is the hugepage size being addressed, the available sizes
120
120
for which vary by system.
121
121
122
+ .. note :: Setting "never" in all sysfs THP controls does **not** disable
123
+ Transparent Huge Pages globally. This is because ``madvise(...,
124
+ MADV_COLLAPSE) `` ignores these settings and collapses ranges to
125
+ PMD-sized huge pages unconditionally.
126
+
122
127
For example::
123
128
124
129
echo always >/sys/kernel/mm/transparent_hugepage/hugepages-2048kB/enabled
@@ -187,7 +192,9 @@ madvise
187
192
behaviour.
188
193
189
194
never
190
- should be self-explanatory.
195
+ should be self-explanatory. Note that ``madvise(...,
196
+ MADV_COLLAPSE) `` can still cause transparent huge pages to be
197
+ obtained even if this mode is specified everywhere.
191
198
192
199
By default kernel tries to use huge, PMD-mappable zero page on read
193
200
page fault to anonymous mapping. It's possible to disable huge zero
@@ -378,7 +385,9 @@ always
378
385
Attempt to allocate huge pages every time we need a new page;
379
386
380
387
never
381
- Do not allocate huge pages;
388
+ Do not allocate huge pages. Note that ``madvise(..., MADV_COLLAPSE) ``
389
+ can still cause transparent huge pages to be obtained even if this mode
390
+ is specified everywhere;
382
391
383
392
within_size
384
393
Only allocate huge page if it will be fully within i_size.
@@ -434,7 +443,9 @@ inherit
434
443
have enabled="inherit" and all other hugepage sizes have enabled="never";
435
444
436
445
never
437
- Do not allocate <size> huge pages;
446
+ Do not allocate <size> huge pages. Note that ``madvise(...,
447
+ MADV_COLLAPSE) `` can still cause transparent huge pages to be obtained
448
+ even if this mode is specified everywhere;
438
449
439
450
within_size
440
451
Only allocate <size> huge page if it will be fully within i_size.
0 commit comments