* + x86-hugetlb-disable-default-cma-reservations-on-32-bit-kernel.patch added to mm-new branch
@ 2026-11-18 3:31 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-11-18 3:31 UTC (permalink / raw)
To: mm-commits, wangkefeng.wang, stable, osalvador, osalvador,
muchun.song, lance.yang, fvdl, david, azpijr, zhengqi.arch, akpm
The patch titled
Subject: x86: hugetlb: disable default CMA reservations on 32-bit kernel
has been added to the -mm mm-new branch. Its filename is
x86-hugetlb-disable-default-cma-reservations-on-32-bit-kernel.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/x86-hugetlb-disable-default-cma-reservations-on-32-bit-kernel.patch
This patch will later appear in the mm-new branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews. Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.
The mm-new branch of mm.git is not included in linux-next
If a few days of testing in mm-new is successful, the patch will me moved
into mm.git's mm-unstable branch, which is included in linux-next
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Qi Zheng <zhengqi.arch@bytedance.com>
Subject: x86: hugetlb: disable default CMA reservations on 32-bit kernel
Date: Tue, 17 Nov 2026 17:33:57 +0800
Patch series "mm: hugetlb: fix CMA-related issues", v5.
This series fixes three CMA-related issues in HugeTLB reservation,
long-term pinning and allocation:
- Avoid ineffective CMA reservations on 32-bit x86 kernels running on
CPUs that advertise 1 GiB page support.
- Allow long-term pins of explicitly CMA-allocated HugeTLB folios,
which already own the CMA memory.
- Preserve the caller's GFP mask when allocating from CMA.
This patch (of 3):
A 32-bit x86 kernel can run on a 64-bit-capable CPU advertising GBPAGES.
arch_hugetlb_cma_order() checks only this feature and returns a nonzero
order, although gigantic HugeTLB support on x86 requires CONFIG_X86_64.
Specifying hugetlb_cma= can therefore reserve a CMA area that cannot
serve the intended gigantic HugeTLB allocations.
On non-PAE kernels, the folded PUD_SHIFT yields a 4 MiB order, which is
equal to MAX_PAGE_ORDER. With CONFIG_DEBUG_VM enabled, this triggers the
VM_WARN_ON(order <= MAX_PAGE_ORDER) check in hugetlb_cma_reserve(),
warning that hugetlb_cma is attempting to reserve a non-gigantic order.
Require CONFIG_X86_64 as well as GBPAGES when selecting the default CMA
order to avoid these ineffective reservations.
Link: https://lore.kernel.org/cover.1794907279.git.zhengqi.arch@bytedance.com
Link: https://lore.kernel.org/6866920502a4eaafd99a9e272df572e3a7d3da4e.1794907279.git.zhengqi.arch@bytedance.com
Fixes: cf11e85fc08c ("mm: hugetlb: optionally allocate gigantic hugepages using cma")
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Muchun Song <muchun.song@linux.dev>
Reviewed-by: Jose A. Perez de Azpillaga <azpijr@gmail.com>
Acked-by: Oscar Salvador <osalvador@suse.de>
Cc: David Hildenbrand <david@kernel.org>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: Frank van der Linden <fvdl@google.com>
Cc: "Oscar Salvador (SUSE)" <osalvador@kernel.org>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: <stable@vger.kernel.org>
arch/x86/mm/hugetlbpage.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/x86/mm/hugetlbpage.c~x86-hugetlb-disable-default-cma-reservations-on-32-bit-kernel
+++ a/arch/x86/mm/hugetlbpage.c
@@ -45,7 +45,7 @@ arch_initcall(gigantic_pages_init);
unsigned int __init arch_hugetlb_cma_order(void)
{
- if (boot_cpu_has(X86_FEATURE_GBPAGES))
+ if (IS_ENABLED(CONFIG_X86_64) && boot_cpu_has(X86_FEATURE_GBPAGES))
return PUD_SHIFT - PAGE_SHIFT;
return 0;
_
Patches currently in -mm which might be from zhengqi.arch@bytedance.com are
x86-hugetlb-disable-default-cma-reservations-on-32-bit-kernel.patch
mm-gup-allow-long-term-pins-of-cma-allocated-hugetlb-folios.patch
mm-hugetlb-fix-gfp-mask-propagation-to-cma.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-18 3:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18 3:31 + x86-hugetlb-disable-default-cma-reservations-on-32-bit-kernel.patch added to mm-new branch Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox