summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorSourav Panda <souravpanda@google.com>2026-08-07 04:00:03 +0000
committerAndrew Morton <akpm@linux-foundation.org>2026-08-24 18:43:11 -0700
commit34e0849142c317eed68f3a4818dd3808fb1c47db (patch)
treeae4bab3466267623a2daf17a8948ea18f38d115b /Documentation
parent28b13c3c4c6592da8dd59a7b06655e39665ee624 (diff)
mm/hugetlb_cma: support percentage-based hugetlb_cma reservation
Currently, hugetlb_cma reservation only supports absolute sizes (e.g., hugetlb_cma=2G or hugetlb_cma=0:1G,1:1G). This can be restrictive in heterogeneous environments or when deploying common kernel command lines across machines with different memory capacities. Add support for percentage-based hugetlb_cma reservation (e.g., hugetlb_cma=20% or hugetlb_cma=0:20%,1:10%). The percentage is calculated against the total memory (for global settings) or against the node-specific memory (for node-specific settings) using memblock APIs during early boot. Link: https://lore.kernel.org/20260807040003.2156630-1-souravpanda@google.com Signed-off-by: Sourav Panda <souravpanda@google.com> Acked-by: Usama Arif <usama.arif@linux.dev> Cc: David Hildenbrand <david@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Frank van der Linden <fvdl@google.com> Cc: Greg Thelen <gthelen@google.com> Cc: Muchun Song <muchun.song@linux.dev> Cc: Oscar Salvador <osalvador@suse.de> Cc: Suren Baghdasaryan <surenb@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/admin-guide/kernel-parameters.txt10
1 files changed, 8 insertions, 2 deletions
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 364c2dce8e70..1af62cd16c9d 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -2064,8 +2064,14 @@ Kernel parameters
hugetlb_cma= [HW,CMA,EARLY] The size of a CMA area used for allocation
of gigantic hugepages. Or using node format, the size
of a CMA area per node can be specified.
- Format: nn[KMGTPE] or (node format)
- <node>:nn[KMGTPE][,<node>:nn[KMGTPE]]
+ The size can be an absolute value (e.g., 2G) or a
+ percentage of the total memory or node memory (e.g., 20%).
+ Percentage-derived sizes are rounded down to a multiple of
+ the architecture's gigantic hugepage size and may become
+ zero.
+ Format: nn[KMGTPE] or nn% or (node format)
+ <node>:nn[KMGTPE][,<node>:nn[KMGTPE]] or
+ <node>:nn%[,<node>:nn%]
The size must be a multiple of the gigantic page size.
When using node format, this applies to each per-node size.