From: Qi Zheng <qi.zheng@linux.dev>
To: muchun.song@linux.dev, osalvador@suse.de, david@kernel.org,
akpm@linux-foundation.org, azpijr@gmail.com,
lance.yang@linux.dev
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v3 0/3] mm: hugetlb: fix CMA-related issues
Date: Sat, 7 Nov 2026 18:30:44 +0800 [thread overview]
Message-ID: <cover.1794046188.git.zhengqi.arch@bytedance.com> (raw)
From: Qi Zheng <zhengqi.arch@bytedance.com>
Hi all,
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.
Changes in v3:
- Drop the cpuset fix. A more comprehensive fix across the HugeTLB
allocation paths will follow in a separate patchset.
- Check for __GFP_COMP instead of adding it in
cma_alloc_frozen_compound(), and leave __GFP_NOWARN to callers.
(suggested by Oscar Salvador)
- Clarify the CMA ownership comment in folio_is_longterm_pinnable().
(suggested by Muchun Song)
- Collect Reviewed-by and Acked-by tags.
Changes in v2:
- Replace the PF_MEMALLOC_PIN allocation restriction with a GUP exception
for HugeTLB folios marked HPG_cma. (suggested by Muchun Song)
- Pass the caller's GFP mask through cma_alloc_frozen_compound() instead
of skipping CMA when direct reclaim is disallowed.
(suggested by sashiko)
- Remove unnecessary revalidation of successfully allocated folios after
cpuset changes. Retry only failed allocations.
(pointed by Jose A. Perez de Azpillaga)
- collect Reviewed-by and Acked-by.
- Rebase onto next-20261104.
Thanks,
Qi
Qi Zheng (3):
x86: hugetlb: disable default CMA reservations on 32-bit kernel
mm: gup: allow long-term pins of CMA-allocated HugeTLB folios
mm: hugetlb: fix GFP mask propagation to CMA
arch/x86/mm/hugetlbpage.c | 2 +-
include/linux/cma.h | 2 +-
include/linux/mm.h | 29 +----------------------------
mm/cma.c | 5 +++--
mm/gup.c | 31 +++++++++++++++++++++++++++++++
mm/hugetlb_cma.c | 4 ++--
6 files changed, 39 insertions(+), 34 deletions(-)
base-commit: 8b7179210b22f8e48a82c5ceacb9d56a9c4cfec4
--
2.54.0
next reply other threads:[~2026-11-07 10:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-07 10:30 Qi Zheng [this message]
2026-11-07 10:30 ` [PATCH v3 1/3] x86: hugetlb: disable default CMA reservations on 32-bit kernel Qi Zheng
2026-11-07 10:30 ` [PATCH v3 2/3] mm: gup: allow long-term pins of CMA-allocated HugeTLB folios Qi Zheng
2026-11-07 17:58 ` David Hildenbrand (Arm)
2026-11-09 3:10 ` Qi Zheng
2026-11-11 7:43 ` David Hildenbrand (Arm)
2026-11-11 10:26 ` Qi Zheng
2026-11-11 22:26 ` Frank van der Linden
2026-11-12 3:27 ` Qi Zheng
2026-11-12 8:36 ` David Hildenbrand (Arm)
2026-11-12 8:40 ` David Hildenbrand (Arm)
2026-11-07 10:30 ` [PATCH v3 3/3] mm: hugetlb: fix GFP mask propagation to CMA Qi Zheng
2026-11-07 17:02 ` Oscar Salvador (SUSE)
2026-11-09 3:10 ` Qi Zheng
2026-11-11 22:05 ` [PATCH v3 0/3] mm: hugetlb: fix CMA-related issues David Hildenbrand (Arm)
2026-11-12 3:25 ` Qi Zheng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1794046188.git.zhengqi.arch@bytedance.com \
--to=qi.zheng@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=azpijr@gmail.com \
--cc=david@kernel.org \
--cc=lance.yang@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=osalvador@suse.de \
--cc=zhengqi.arch@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.