Re: [PATCH v2] mm/hugetlb_cma: support percentage-based hugetlb_cma reservation

From: Sourav Panda

Date: Wed Jul 29 2026 - 12:48:03 EST


On Wed, Jul 29, 2026 at 1:52 AM David Hildenbrand (Arm)
<david@xxxxxxxxxx> wrote:
>
> On 6/28/26 21:01, Sourav Panda 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.
> >
> > 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/
> > ---
> > Link: https://lore.kernel.org/linux-mm/20260625215900.2151690-1-souravpanda@xxxxxxxxxx/ [v1]
> >
> > v2:
> > - Use mul_u64_u32_div() instead of mult_frac() to avoid 64-bit division on 32-bit architectures (Reported by kernel test robot).
> > - Fix physical memory size truncation on 32-bit PAE by using phys_addr_t in memblock_node_memory_size() (Sashiko).
> > - Fix boot parameter override logic to respect standard last-one-wins precedence by clearing opposite values during parsing and clearing node-specific values when global values are parsed.
> > .../admin-guide/kernel-parameters.txt | 7 +-
> > mm/hugetlb_cma.c | 96 ++++++++++++++++++-
> > 2 files changed, 97 insertions(+), 6 deletions(-)
>
> What's the status of this? Reading the comments I assume a v3?

Thanks David for checking.

Just sent v3: https://lore.kernel.org/linux-mm/20260729163148.3271755-1-souravpanda@xxxxxxxxxx/

>
> --
> Cheers,
>
> David