Re: [PATCH v2] mm/hugetlb_cma: support percentage-based hugetlb_cma reservation
From: Andrew Morton
Date: Sun Jun 28 2026 - 15:39:04 EST
On Sun, 28 Jun 2026 19:01:55 +0000 Sourav Panda <souravpanda@xxxxxxxxxx> wrote:
> 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.
Thanks, I'll queue this for testing and additional review.
There are a couple of pr_infos in this code, to give people an
understanding of how the kernel has sized these things. Would it make
sense to enhance those, to help our operator to understand/confirm what
effect the chosen percentage configuration had?
> Signed-off-by: Sourav Panda <souravpanda@xxxxxxxxxx>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202606262023.IKUrn01I-lkp@xxxxxxxxx/
Robot found issues in the v1 patch. This development-time info isn't
something which we (at least, I) normally include in the permanent
kernel record.