Linux real-time development
 help / color / mirror / Atom feed
* [PATCH v2 00/13] mm: Some cleanups for page allocator APIs
@ 2026-06-22 10:01 Brendan Jackman
  2026-06-22 10:01 ` [PATCH v2 01/13] mm/page_alloc: rename ALLOC_TRYLOCK -> ALLOC_NOLOCK Brendan Jackman
                   ` (14 more replies)
  0 siblings, 15 replies; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 10:01 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan, Muchun Song, Oscar Salvador,
	David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Mike Rapoport, Matthew Brost, Joshua Hahn, Rakie Kim,
	Byungchul Park, Ying Huang, Alistair Popple, Hao Li,
	Christoph Lameter, David Rientjes, Roman Gushchin,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt
  Cc: Harry Yoo (Oracle), Gregory Price, Johannes Weiner,
	Alexei Starovoitov, Matthew Wilcox, linux-mm, linux-kernel,
	linux-rt-devel, Brendan Jackman, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	James Clark, Sean Christopherson, Paolo Bonzini, kvm,
	Thomas Gleixner, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Robin Holt, Steve Wahl, Arnd Bergmann,
	Greg Kroah-Hartman, Dimitris Michailidis, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni

Some tweaks and cleanups for page allocator entrypoint and flags. This
is motivated by preparation for __GFP_UNMAPPED [1] (which will probably
become ALLOC_UNMAPPED in its next iteration), but all this is supposed
to be an improvement to the codebase in its own right: unifying code
paths, reducing API surface, and removing GFP flags.

[1] https://lore.kernel.org/all/20260320-page_alloc-unmapped-v2-0-28bf1bd54f41@google.com/

This started with unifying  __alloc_frozen_pages[_nolock]_noprof() and
expanded from there.

Unifying the nolock allocator entrypoint with the normal allocator
entrypoint means adding an alloc_flags argument to the later (only
exposed within mm/). This presents an opportunity to take advantage of
that arg to remove some GFP flags, if we add that alloc_flags arg a bit
more broadly to allocator entrypoints.

To distinguish between mm-internal and "public" allocator entrypoints,
it makes sense to use the __ prefix. There are already some public APIs
with that prefix. For *alloc_pages*, just removing those variants seems
like a nice cleanup anyway, so do that. For get_free_pages, the "__"
variant is the _only_ variant and it's very widely used, so it doesn't
seem worthwhile to modify that. Therefore, scope this "__" change
specifically to the *alloc_pages* API, which means we leave the
*folio_alloc* API untouched too, even though that could probably be
cleaned up if so desired.

Tested:

- KVM, mm, and BPF selftests in a QEMU VM

- kunit.py on x86_64

- For the ALLOC_NO_CODETAG bits I just booted a VM and read
  /proc/allocinfo. I confirmed that if I remove ALLOC_NO_CODETAG, the
  kernel crashes in early boot, so I was at least booting code that
  depends on this logic.

I used Google's internal version of Antigravity (AI coding harness) to
do the repetitive bits, those commits are marked with Assisted-by, the
rest is manual.

Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
Changes in v2:
- Fixed up whitespace in nolock unification patch
- Introduced ALLOC_DEFAULT to replace literal 0 for alloc_flags
- All other patches are new
- Link to v1: https://patch.msgid.link/20260617-alloc-trylock-v1-1-83fd7858832e@google.com

---
Brendan Jackman (13):
      mm/page_alloc: rename ALLOC_TRYLOCK -> ALLOC_NOLOCK
      mm/page_alloc: some renames to clarify alloc_flags scopes
      mm/page_alloc: unify __alloc_frozen_pages[_nolock]_noprof()
      mm/page_alloc: relax GFP WARN in nolock allocs
      perf/x86/intel: Use higher-level allocator
      KVM: VMX: Use higher-level allocator
      x86/virt: Use higher-level allocator
      sgi-xp: Use higher-level allocator
      net/funeth: Switch to higher-level allocator
      mm: Remove __alloc_pages_node()
      alloc_tag: Move to mm/
      mm: Move __alloc_pages() to mm/internal.h
      mm: remove __GFP_NO_CODETAG

 Documentation/admin-guide/cgroup-v1/cpusets.rst  |   2 +-
 Documentation/admin-guide/mm/transhuge.rst       |   2 +-
 MAINTAINERS                                      |   2 +-
 arch/x86/events/intel/ds.c                       |   6 +-
 arch/x86/kvm/vmx/vmx.c                           |   2 +-
 arch/x86/virt/hw.c                               |   2 +-
 drivers/misc/sgi-xp/xpc_uv.c                     |   2 +-
 drivers/net/ethernet/fungible/funeth/funeth_rx.c |   2 +-
 include/linux/gfp.h                              |  28 +--
 lib/Makefile                                     |   1 -
 mm/Makefile                                      |   1 +
 {lib => mm}/alloc_tag.c                          |  18 +-
 mm/compaction.c                                  |   4 +-
 mm/hugetlb.c                                     |   3 +-
 mm/internal.h                                    |  20 +-
 mm/mempolicy.c                                   |  10 +-
 mm/page_alloc.c                                  | 254 +++++++++++++----------
 mm/page_frag_cache.c                             |   4 +-
 mm/slub.c                                        |   6 +-
 19 files changed, 193 insertions(+), 176 deletions(-)
---
base-commit: cbe5256a15fc26f592efb037e528da54b2139ee5
change-id: 20260617-alloc-trylock-14ad37dab337

Best regards,
--  
Brendan Jackman <jackmanb@google.com>


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v2 01/13] mm/page_alloc: rename ALLOC_TRYLOCK -> ALLOC_NOLOCK
  2026-06-22 10:01 [PATCH v2 00/13] mm: Some cleanups for page allocator APIs Brendan Jackman
@ 2026-06-22 10:01 ` Brendan Jackman
  2026-06-22 10:01 ` [PATCH v2 02/13] mm/page_alloc: some renames to clarify alloc_flags scopes Brendan Jackman
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 10:01 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan, Muchun Song, Oscar Salvador,
	David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Mike Rapoport, Matthew Brost, Joshua Hahn, Rakie Kim,
	Byungchul Park, Ying Huang, Alistair Popple, Hao Li,
	Christoph Lameter, David Rientjes, Roman Gushchin,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt
  Cc: Harry Yoo (Oracle), Gregory Price, Johannes Weiner,
	Alexei Starovoitov, Matthew Wilcox, linux-mm, linux-kernel,
	linux-rt-devel, Brendan Jackman

It's confusing that the function is called "nolock" but the flag is
called "trylock", align them.

The function's terminology is more visible and has more mindshare so use that.

Suggested-by: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Link: https://lore.kernel.org/linux-mm/2399b3ad-4eac-4a14-94c3-27e9f07972a1@kernel.org/
Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 mm/internal.h   |  2 +-
 mm/page_alloc.c | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/mm/internal.h b/mm/internal.h
index 181e79f1d6a20..1483a4fcdfce1 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -1475,7 +1475,7 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,
 #define ALLOC_NOFRAGMENT	  0x0
 #endif
 #define ALLOC_HIGHATOMIC	0x200 /* Allows access to MIGRATE_HIGHATOMIC */
-#define ALLOC_TRYLOCK		0x400 /* Only use spin_trylock in allocation path */
+#define ALLOC_NOLOCK		0x400 /* Only use spin_trylock in allocation path */
 #define ALLOC_KSWAPD		0x800 /* allow waking of kswapd, __GFP_KSWAPD_RECLAIM set */
 
 /* Flags that allow allocations below the min watermark. */
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 0111cdbdb5321..6c4eb6908bd95 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2528,7 +2528,7 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,
 	unsigned long flags;
 	int i;
 
-	if (unlikely(alloc_flags & ALLOC_TRYLOCK)) {
+	if (unlikely(alloc_flags & ALLOC_NOLOCK)) {
 		if (!spin_trylock_irqsave(&zone->lock, flags))
 			return 0;
 	} else {
@@ -3216,7 +3216,7 @@ struct page *rmqueue_buddy(struct zone *preferred_zone, struct zone *zone,
 
 	do {
 		page = NULL;
-		if (unlikely(alloc_flags & ALLOC_TRYLOCK)) {
+		if (unlikely(alloc_flags & ALLOC_NOLOCK)) {
 			if (!spin_trylock_irqsave(&zone->lock, flags))
 				return NULL;
 		} else {
@@ -5042,7 +5042,7 @@ static inline bool prepare_alloc_pages(gfp_t gfp_mask, unsigned int order,
 	 * Don't invoke should_fail logic, since it may call
 	 * get_random_u32() and printk() which need to spin_lock.
 	 */
-	if (!(*alloc_flags & ALLOC_TRYLOCK) &&
+	if (!(*alloc_flags & ALLOC_NOLOCK) &&
 	    should_fail_alloc_page(gfp_mask, order))
 		return false;
 
@@ -7786,7 +7786,7 @@ static bool cond_accept_memory(struct zone *zone, unsigned int order,
 		return false;
 
 	/* Bailout, since try_to_accept_memory_one() needs to take a lock */
-	if (alloc_flags & ALLOC_TRYLOCK)
+	if (alloc_flags & ALLOC_NOLOCK)
 		return false;
 
 	wmark = promo_wmark_pages(zone);
@@ -7878,7 +7878,7 @@ struct page *alloc_frozen_pages_nolock_noprof(gfp_t gfp_flags, int nid, unsigned
 	 */
 	gfp_t alloc_gfp = __GFP_NOWARN | __GFP_ZERO | __GFP_NOMEMALLOC | __GFP_COMP
 			| gfp_flags;
-	unsigned int alloc_flags = ALLOC_TRYLOCK;
+	unsigned int alloc_flags = ALLOC_NOLOCK;
 	struct alloc_context ac = { };
 	struct page *page;
 

-- 
2.54.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 02/13] mm/page_alloc: some renames to clarify alloc_flags scopes
  2026-06-22 10:01 [PATCH v2 00/13] mm: Some cleanups for page allocator APIs Brendan Jackman
  2026-06-22 10:01 ` [PATCH v2 01/13] mm/page_alloc: rename ALLOC_TRYLOCK -> ALLOC_NOLOCK Brendan Jackman
@ 2026-06-22 10:01 ` Brendan Jackman
  2026-06-22 10:01 ` [PATCH v2 03/13] mm/page_alloc: unify __alloc_frozen_pages[_nolock]_noprof() Brendan Jackman
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 10:01 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan, Muchun Song, Oscar Salvador,
	David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Mike Rapoport, Matthew Brost, Joshua Hahn, Rakie Kim,
	Byungchul Park, Ying Huang, Alistair Popple, Hao Li,
	Christoph Lameter, David Rientjes, Roman Gushchin,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt
  Cc: Harry Yoo (Oracle), Gregory Price, Johannes Weiner,
	Alexei Starovoitov, Matthew Wilcox, linux-mm, linux-kernel,
	linux-rt-devel, Brendan Jackman

It's pretty confusing that:

- The slowpath and fastpath have a totally distinct set of alloc_flags.

- gfp_to_alloc_flags() sounds generic but it only influences the
  slowpath.

- prepare_alloc_pages() is generic in that it sets up the
  alloc_context, but the alloc_flags it generates are only used for the
  fastpath.

Rename some variables to highlight which alloc_flags are
fastpath-specific. Rename gfp_to_alloc_flags() to highlight that it's
slowpath-specific.

gfp_to_alloc_flags_cma()'s current name is actually fine, but rename it
anyway, just for consistency.

Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 mm/page_alloc.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 6c4eb6908bd95..bc05d75a41627 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3771,8 +3771,8 @@ alloc_flags_nofragment(struct zone *zone, gfp_t gfp_mask)
 }
 
 /* Must be called after current_gfp_context() which can change gfp_mask */
-static inline unsigned int gfp_to_alloc_flags_cma(gfp_t gfp_mask,
-						  unsigned int alloc_flags)
+static inline unsigned int cma_alloc_flags(gfp_t gfp_mask,
+					   unsigned int alloc_flags)
 {
 #ifdef CONFIG_CMA
 	if (gfp_migratetype(gfp_mask) == MIGRATE_MOVABLE)
@@ -4471,7 +4471,7 @@ static void wake_all_kswapds(unsigned int order, gfp_t gfp_mask,
 }
 
 static inline unsigned int
-gfp_to_alloc_flags(gfp_t gfp_mask, unsigned int order)
+slowpath_alloc_flags(gfp_t gfp_mask, unsigned int order)
 {
 	unsigned int alloc_flags = ALLOC_WMARK_MIN | ALLOC_CPUSET;
 
@@ -4508,7 +4508,7 @@ gfp_to_alloc_flags(gfp_t gfp_mask, unsigned int order)
 	} else if (unlikely(rt_or_dl_task(current)) && in_task())
 		alloc_flags |= ALLOC_MIN_RESERVE;
 
-	alloc_flags = gfp_to_alloc_flags_cma(gfp_mask, alloc_flags);
+	alloc_flags = cma_alloc_flags(gfp_mask, alloc_flags);
 
 	if (defrag_mode)
 		alloc_flags |= ALLOC_NOFRAGMENT;
@@ -4774,7 +4774,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
 	 * kswapd needs to be woken up, and to avoid the cost of setting up
 	 * alloc_flags precisely. So we do that now.
 	 */
-	alloc_flags = gfp_to_alloc_flags(gfp_mask, order);
+	alloc_flags = slowpath_alloc_flags(gfp_mask, order);
 
 	/*
 	 * We need to recalculate the starting point for the zonelist iterator
@@ -4815,7 +4815,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
 
 	reserve_flags = __gfp_pfmemalloc_flags(gfp_mask);
 	if (reserve_flags)
-		alloc_flags = gfp_to_alloc_flags_cma(gfp_mask, reserve_flags) |
+		alloc_flags = cma_alloc_flags(gfp_mask, reserve_flags) |
 					  (alloc_flags & ALLOC_KSWAPD);
 
 	/*
@@ -5017,7 +5017,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
 static inline bool prepare_alloc_pages(gfp_t gfp_mask, unsigned int order,
 		int preferred_nid, nodemask_t *nodemask,
 		struct alloc_context *ac, gfp_t *alloc_gfp,
-		unsigned int *alloc_flags)
+		unsigned int *fastpath_alloc_flags)
 {
 	ac->highest_zoneidx = gfp_zone(gfp_mask);
 	ac->zonelist = node_zonelist(preferred_nid, gfp_mask);
@@ -5033,7 +5033,7 @@ static inline bool prepare_alloc_pages(gfp_t gfp_mask, unsigned int order,
 		if (in_task() && !ac->nodemask)
 			ac->nodemask = &cpuset_current_mems_allowed;
 		else
-			*alloc_flags |= ALLOC_CPUSET;
+			*fastpath_alloc_flags |= ALLOC_CPUSET;
 	}
 
 	might_alloc(gfp_mask);
@@ -5042,11 +5042,11 @@ static inline bool prepare_alloc_pages(gfp_t gfp_mask, unsigned int order,
 	 * Don't invoke should_fail logic, since it may call
 	 * get_random_u32() and printk() which need to spin_lock.
 	 */
-	if (!(*alloc_flags & ALLOC_NOLOCK) &&
+	if (!(*fastpath_alloc_flags & ALLOC_NOLOCK) &&
 	    should_fail_alloc_page(gfp_mask, order))
 		return false;
 
-	*alloc_flags = gfp_to_alloc_flags_cma(gfp_mask, *alloc_flags);
+	*fastpath_alloc_flags = cma_alloc_flags(gfp_mask, *fastpath_alloc_flags);
 
 	/* Dirty zone balancing only done in the fast path */
 	ac->spread_dirty_pages = (gfp_mask & __GFP_WRITE);
@@ -5260,7 +5260,7 @@ struct page *__alloc_frozen_pages_noprof(gfp_t gfp, unsigned int order,
 		int preferred_nid, nodemask_t *nodemask)
 {
 	struct page *page;
-	unsigned int alloc_flags = ALLOC_WMARK_LOW;
+	unsigned int fastpath_alloc_flags = ALLOC_WMARK_LOW;
 	gfp_t alloc_gfp; /* The gfp_t that was actually used for allocation */
 	struct alloc_context ac = { };
 
@@ -5282,17 +5282,17 @@ struct page *__alloc_frozen_pages_noprof(gfp_t gfp, unsigned int order,
 	gfp = current_gfp_context(gfp);
 	alloc_gfp = gfp;
 	if (!prepare_alloc_pages(gfp, order, preferred_nid, nodemask, &ac,
-			&alloc_gfp, &alloc_flags))
+			&alloc_gfp, &fastpath_alloc_flags))
 		return NULL;
 
 	/*
 	 * Forbid the first pass from falling back to types that fragment
 	 * memory until all local zones are considered.
 	 */
-	alloc_flags |= alloc_flags_nofragment(zonelist_zone(ac.preferred_zoneref), gfp);
+	fastpath_alloc_flags |= alloc_flags_nofragment(zonelist_zone(ac.preferred_zoneref), gfp);
 
 	/* First allocation attempt */
-	page = get_page_from_freelist(alloc_gfp, order, alloc_flags, &ac);
+	page = get_page_from_freelist(alloc_gfp, order, fastpath_alloc_flags, &ac);
 	if (likely(page))
 		goto out;
 

-- 
2.54.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 03/13] mm/page_alloc: unify __alloc_frozen_pages[_nolock]_noprof()
  2026-06-22 10:01 [PATCH v2 00/13] mm: Some cleanups for page allocator APIs Brendan Jackman
  2026-06-22 10:01 ` [PATCH v2 01/13] mm/page_alloc: rename ALLOC_TRYLOCK -> ALLOC_NOLOCK Brendan Jackman
  2026-06-22 10:01 ` [PATCH v2 02/13] mm/page_alloc: some renames to clarify alloc_flags scopes Brendan Jackman
@ 2026-06-22 10:01 ` Brendan Jackman
  2026-06-22 10:01 ` [PATCH v2 04/13] mm/page_alloc: relax GFP WARN in nolock allocs Brendan Jackman
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 10:01 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan, Muchun Song, Oscar Salvador,
	David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Mike Rapoport, Matthew Brost, Joshua Hahn, Rakie Kim,
	Byungchul Park, Ying Huang, Alistair Popple, Hao Li,
	Christoph Lameter, David Rientjes, Roman Gushchin,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt
  Cc: Harry Yoo (Oracle), Gregory Price, Johannes Weiner,
	Alexei Starovoitov, Matthew Wilcox, linux-mm, linux-kernel,
	linux-rt-devel, Brendan Jackman

Currently the core allocator code is controlled by ALLOC_NOLOCK, but the
main entry point function is significantly different from the normal
__alloc_frozen_pages_nolock(), this is tiring when reading the code.

Plumb the ALLOC_NOLOCK control one layer up in the call stack: create
an alloc_flags argument to __alloc_frozen_pages_nolock() (which is only
exposed to mm/) and then turn the nolock variant into a thin wrapper
that just sets that flag (as well as handling NUMA_NO_NODE, similar to
how some of the wrappers in gfp.h do).

Rationale that this doesn't change anything:

1. Simple bits: A bunch of the nolock-specific handling is just moved to
   the new alloc_order_allowed(), alloc_trylock_allowed() and
   gfp_trylock.

2. __alloc_frozen_pages_noprof() has some extra logic that wasn't
   previously in the nolock variant:

   a. Application of gfp_allowed_mask; this only affects early boot, and
      only flags that affect the slowpath get changed here.

   b. Application of current_gfp_context() - also only affects the
      slowpath

3. The slowpath itself: this is now just explicitly skipped under
   !ALLOC_TRYLOCK.

Ulterior motive: adding an alloc_flags arg to the allocator's
mm-internal entrypoint can later be used to do more allocation
customisation without needing to create new GFP flags.

While adding this flag to a bunch of places, create ALLOC_DEFAULT to
avoid a mysterious literal 0 in most places. alloc_frozen_pages_noprof()
is defined above the alloc flags so just leave that as a slightly messy
exception instead of trying to fully reorder mm/internal.h for that one
case.

No functional change intended.

Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 mm/hugetlb.c    |   3 +-
 mm/internal.h   |   8 ++-
 mm/mempolicy.c  |  10 ++--
 mm/page_alloc.c | 178 +++++++++++++++++++++++++++++---------------------------
 mm/slub.c       |   6 +-
 5 files changed, 110 insertions(+), 95 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 571212b80835e..2ce6169ca0dfd 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1806,7 +1806,8 @@ static struct folio *alloc_buddy_frozen_folio(int order, gfp_t gfp_mask,
 	if (alloc_try_hard)
 		gfp_mask |= __GFP_RETRY_MAYFAIL;
 
-	folio = (struct folio *)__alloc_frozen_pages(gfp_mask, order, nid, nmask);
+	folio = (struct folio *)__alloc_frozen_pages(gfp_mask, order, nid, nmask,
+						     ALLOC_DEFAULT);
 
 	/*
 	 * If we did not specify __GFP_RETRY_MAYFAIL, but still got a
diff --git a/mm/internal.h b/mm/internal.h
index 1483a4fcdfce1..6bc89ec62e527 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -913,7 +913,7 @@ extern bool free_pages_prepare(struct page *page, unsigned int order);
 extern int user_min_free_kbytes;
 
 struct page *__alloc_frozen_pages_noprof(gfp_t, unsigned int order, int nid,
-		nodemask_t *);
+		nodemask_t *, unsigned int alloc_flags);
 #define __alloc_frozen_pages(...) \
 	alloc_hooks(__alloc_frozen_pages_noprof(__VA_ARGS__))
 void free_frozen_pages(struct page *page, unsigned int order);
@@ -924,7 +924,8 @@ struct page *alloc_frozen_pages_noprof(gfp_t, unsigned int order);
 #else
 static inline struct page *alloc_frozen_pages_noprof(gfp_t gfp, unsigned int order)
 {
-	return __alloc_frozen_pages_noprof(gfp, order, numa_node_id(), NULL);
+	return __alloc_frozen_pages_noprof(gfp, order, numa_node_id(), NULL,
+					   0 /* ALLOC_DEFAULT */);
 }
 #endif
 
@@ -1440,6 +1441,9 @@ extern void set_pageblock_order(void);
 unsigned long reclaim_pages(struct list_head *folio_list);
 unsigned int reclaim_clean_pages_from_list(struct zone *zone,
 					    struct list_head *folio_list);
+
+
+#define ALLOC_DEFAULT		0
 /* The ALLOC_WMARK bits are used as an index to zone->watermark */
 #define ALLOC_WMARK_MIN		WMARK_MIN
 #define ALLOC_WMARK_LOW		WMARK_LOW
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 36699fabd3c22..40bbea614aced 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2425,9 +2425,11 @@ static struct page *alloc_pages_preferred_many(gfp_t gfp, unsigned int order,
 	 */
 	preferred_gfp = gfp | __GFP_NOWARN;
 	preferred_gfp &= ~(__GFP_DIRECT_RECLAIM | __GFP_NOFAIL);
-	page = __alloc_frozen_pages_noprof(preferred_gfp, order, nid, nodemask);
+	page = __alloc_frozen_pages_noprof(preferred_gfp, order, nid, nodemask,
+					   ALLOC_DEFAULT);
 	if (!page)
-		page = __alloc_frozen_pages_noprof(gfp, order, nid, NULL);
+		page = __alloc_frozen_pages_noprof(gfp, order, nid, NULL,
+						   ALLOC_DEFAULT);
 
 	return page;
 }
@@ -2475,7 +2477,7 @@ static struct page *alloc_pages_mpol(gfp_t gfp, unsigned int order,
 			 */
 			page = __alloc_frozen_pages_noprof(
 				gfp | __GFP_THISNODE | __GFP_NORETRY, order,
-				nid, NULL);
+				nid, NULL, ALLOC_DEFAULT);
 			if (page || !(gfp & __GFP_DIRECT_RECLAIM))
 				return page;
 			/*
@@ -2487,7 +2489,7 @@ static struct page *alloc_pages_mpol(gfp_t gfp, unsigned int order,
 		}
 	}
 
-	page = __alloc_frozen_pages_noprof(gfp, order, nid, nodemask);
+	page = __alloc_frozen_pages_noprof(gfp, order, nid, nodemask, ALLOC_DEFAULT);
 
 	if (unlikely(pol->mode == MPOL_INTERLEAVE ||
 		     pol->mode == MPOL_WEIGHTED_INTERLEAVE) && page) {
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index bc05d75a41627..e31babe2181a1 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5204,7 +5204,7 @@ unsigned long alloc_pages_bulk_noprof(gfp_t gfp, int preferred_nid,
 		}
 		nr_account++;
 
-		prep_new_page(page, 0, gfp, 0);
+		prep_new_page(page, 0, gfp, ALLOC_DEFAULT);
 		set_page_refcounted(page);
 		page_array[nr_populated++] = page;
 	}
@@ -5253,24 +5253,98 @@ void free_pages_bulk(struct page **page_array, unsigned long nr_pages)
 	}
 }
 
-/*
- * This is the 'heart' of the zoned buddy allocator.
- */
-struct page *__alloc_frozen_pages_noprof(gfp_t gfp, unsigned int order,
-		int preferred_nid, nodemask_t *nodemask)
+static inline bool alloc_order_allowed(gfp_t gfp, unsigned int order,
+				       unsigned int alloc_flags)
 {
-	struct page *page;
-	unsigned int fastpath_alloc_flags = ALLOC_WMARK_LOW;
-	gfp_t alloc_gfp; /* The gfp_t that was actually used for allocation */
-	struct alloc_context ac = { };
+	if (alloc_flags & ALLOC_NOLOCK)
+		return pcp_allowed_order(order);
 
 	/*
 	 * There are several places where we assume that the order value is sane
 	 * so bail out early if the request is out of bound.
 	 */
-	if (WARN_ON_ONCE_GFP(order > MAX_PAGE_ORDER, gfp))
+	return !(WARN_ON_ONCE_GFP(order > MAX_PAGE_ORDER, gfp));
+}
+
+static inline bool alloc_trylock_allowed(void)
+{
+	/*
+	 * In PREEMPT_RT spin_trylock() will call raw_spin_lock() which is
+	 * unsafe in NMI. If spin_trylock() is called from hard IRQ the current
+	 * task may be waiting for one rt_spin_lock, but rt_spin_trylock() will
+	 * mark the task as the owner of another rt_spin_lock which will
+	 * confuse PI logic, so return immediately if called from hard IRQ or
+	 * NMI.
+	 *
+	 * Note, irqs_disabled() case is ok. This function can be called
+	 * from raw_spin_lock_irqsave region.
+	 */
+	if (IS_ENABLED(CONFIG_PREEMPT_RT) && (in_nmi() || in_hardirq()))
+		return false;
+
+	/* On UP, spin_trylock() always succeeds even when it is locked */
+	if (!IS_ENABLED(CONFIG_SMP) && in_nmi())
+		return false;
+
+	/* Bailout, since _deferred_grow_zone() needs to take a lock */
+	if (deferred_pages_enabled())
+		return false;
+
+	return true;
+}
+
+/*
+ * GFP flags to set for ALLOC_NOLOCK i.e. alloc_pages_nolock().
+ *
+ * Do not specify __GFP_DIRECT_RECLAIM, since direct claim is not allowed.
+ * Do not specify __GFP_KSWAPD_RECLAIM either, since wake up of kswapd
+ * is not safe in arbitrary context.
+ *
+ * These two are the conditions for gfpflags_allow_spinning() being true.
+ *
+ * Specify __GFP_NOWARN since failing alloc_pages_nolock() is not a reason
+ * to warn. Also warn would trigger printk() which is unsafe from
+ * various contexts. We cannot use printk_deferred_enter() to mitigate,
+ * since the running context is unknown.
+ *
+ * Specify __GFP_ZERO to make sure that call to kmsan_alloc_page() below
+ * is safe in any context. Also zeroing the page is mandatory for
+ * BPF use cases.
+ *
+ * Though __GFP_NOMEMALLOC is not checked in the code path below,
+ * specify it here to highlight that alloc_pages_nolock()
+ * doesn't want to deplete reserves.
+ */
+static const gfp_t gfp_nolock = __GFP_NOWARN | __GFP_ZERO | __GFP_NOMEMALLOC |
+				__GFP_COMP;
+
+/*
+ * This is the 'heart' of the zoned buddy allocator.
+ */
+struct page *__alloc_frozen_pages_noprof(gfp_t gfp, unsigned int order,
+		int preferred_nid, nodemask_t *nodemask, unsigned int alloc_flags)
+{
+	struct page *page;
+	gfp_t alloc_gfp; /* The gfp_t that was actually used for allocation */
+	struct alloc_context ac = { };
+	unsigned int fastpath_alloc_flags = alloc_flags;
+
+	/* Other flags could be supported later if needed. */
+	if (WARN_ON(alloc_flags & ~ALLOC_NOLOCK))
 		return NULL;
 
+	if (!alloc_order_allowed(gfp, order, alloc_flags))
+		return NULL;
+
+	if (alloc_flags & ALLOC_NOLOCK) {
+		VM_WARN_ON_ONCE(gfp & ~__GFP_ACCOUNT);
+		if (!alloc_trylock_allowed())
+			return NULL;
+		gfp |= gfp_nolock;
+	} else {
+		fastpath_alloc_flags |= ALLOC_WMARK_LOW;
+	}
+
 	gfp &= gfp_allowed_mask;
 	/*
 	 * Apply scoped allocation constraints. This is mainly about GFP_NOFS
@@ -5291,9 +5365,9 @@ struct page *__alloc_frozen_pages_noprof(gfp_t gfp, unsigned int order,
 	 */
 	fastpath_alloc_flags |= alloc_flags_nofragment(zonelist_zone(ac.preferred_zoneref), gfp);
 
-	/* First allocation attempt */
+	/* First allocation attempt (or, for nolock, only attempt) */
 	page = get_page_from_freelist(alloc_gfp, order, fastpath_alloc_flags, &ac);
-	if (likely(page))
+	if (likely(page) || (alloc_flags & ALLOC_NOLOCK))
 		goto out;
 
 	alloc_gfp = gfp;
@@ -5310,7 +5384,8 @@ struct page *__alloc_frozen_pages_noprof(gfp_t gfp, unsigned int order,
 out:
 	if (memcg_kmem_online() && (gfp & __GFP_ACCOUNT) && page &&
 	    unlikely(__memcg_kmem_charge_page(page, gfp, order) != 0)) {
-		free_frozen_pages(page, order);
+		__free_frozen_pages(page, order,
+				    alloc_flags & ALLOC_NOLOCK ? FPI_TRYLOCK : 0);
 		page = NULL;
 	}
 
@@ -5326,7 +5401,8 @@ struct page *__alloc_pages_noprof(gfp_t gfp, unsigned int order,
 {
 	struct page *page;
 
-	page = __alloc_frozen_pages_noprof(gfp, order, preferred_nid, nodemask);
+	page = __alloc_frozen_pages_noprof(gfp, order, preferred_nid, nodemask,
+					   ALLOC_DEFAULT);
 	if (page)
 		set_page_refcounted(page);
 	return page;
@@ -7856,80 +7932,10 @@ static bool __free_unaccepted(struct page *page)
 
 struct page *alloc_frozen_pages_nolock_noprof(gfp_t gfp_flags, int nid, unsigned int order)
 {
-	/*
-	 * Do not specify __GFP_DIRECT_RECLAIM, since direct claim is not allowed.
-	 * Do not specify __GFP_KSWAPD_RECLAIM either, since wake up of kswapd
-	 * is not safe in arbitrary context.
-	 *
-	 * These two are the conditions for gfpflags_allow_spinning() being true.
-	 *
-	 * Specify __GFP_NOWARN since failing alloc_pages_nolock() is not a reason
-	 * to warn. Also warn would trigger printk() which is unsafe from
-	 * various contexts. We cannot use printk_deferred_enter() to mitigate,
-	 * since the running context is unknown.
-	 *
-	 * Specify __GFP_ZERO to make sure that call to kmsan_alloc_page() below
-	 * is safe in any context. Also zeroing the page is mandatory for
-	 * BPF use cases.
-	 *
-	 * Though __GFP_NOMEMALLOC is not checked in the code path below,
-	 * specify it here to highlight that alloc_pages_nolock()
-	 * doesn't want to deplete reserves.
-	 */
-	gfp_t alloc_gfp = __GFP_NOWARN | __GFP_ZERO | __GFP_NOMEMALLOC | __GFP_COMP
-			| gfp_flags;
-	unsigned int alloc_flags = ALLOC_NOLOCK;
-	struct alloc_context ac = { };
-	struct page *page;
-
-	VM_WARN_ON_ONCE(gfp_flags & ~__GFP_ACCOUNT);
-	/*
-	 * In PREEMPT_RT spin_trylock() will call raw_spin_lock() which is
-	 * unsafe in NMI. If spin_trylock() is called from hard IRQ the current
-	 * task may be waiting for one rt_spin_lock, but rt_spin_trylock() will
-	 * mark the task as the owner of another rt_spin_lock which will
-	 * confuse PI logic, so return immediately if called from hard IRQ or
-	 * NMI.
-	 *
-	 * Note, irqs_disabled() case is ok. This function can be called
-	 * from raw_spin_lock_irqsave region.
-	 */
-	if (IS_ENABLED(CONFIG_PREEMPT_RT) && (in_nmi() || in_hardirq()))
-		return NULL;
-
-	/* On UP, spin_trylock() always succeeds even when it is locked */
-	if (!IS_ENABLED(CONFIG_SMP) && in_nmi())
-		return NULL;
-
-	if (!pcp_allowed_order(order))
-		return NULL;
-
-	/* Bailout, since _deferred_grow_zone() needs to take a lock */
-	if (deferred_pages_enabled())
-		return NULL;
-
 	if (nid == NUMA_NO_NODE)
 		nid = numa_node_id();
 
-	prepare_alloc_pages(alloc_gfp, order, nid, NULL, &ac,
-			    &alloc_gfp, &alloc_flags);
-
-	/*
-	 * Best effort allocation from percpu free list.
-	 * If it's empty attempt to spin_trylock zone->lock.
-	 */
-	page = get_page_from_freelist(alloc_gfp, order, alloc_flags, &ac);
-
-	/* Unlike regular alloc_pages() there is no __alloc_pages_slowpath(). */
-
-	if (memcg_kmem_online() && page && (gfp_flags & __GFP_ACCOUNT) &&
-	    unlikely(__memcg_kmem_charge_page(page, alloc_gfp, order) != 0)) {
-		__free_frozen_pages(page, order, FPI_TRYLOCK);
-		page = NULL;
-	}
-	trace_mm_page_alloc(page, order, alloc_gfp, ac.migratetype);
-	kmsan_alloc_page(page, order, alloc_gfp);
-	return page;
+	return __alloc_frozen_pages_noprof(gfp_flags, order, nid, NULL, ALLOC_NOLOCK);
 }
 /**
  * alloc_pages_nolock - opportunistic reentrant allocation from any context
diff --git a/mm/slub.c b/mm/slub.c
index a2bf3756ca7d0..b9c1284844a0a 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3275,7 +3275,8 @@ static inline struct slab *alloc_slab_page(gfp_t flags, int node,
 	else if (node == NUMA_NO_NODE)
 		page = alloc_frozen_pages(flags, order);
 	else
-		page = __alloc_frozen_pages(flags, order, node, NULL);
+		page = __alloc_frozen_pages(flags, order, node, NULL,
+					    ALLOC_DEFAULT);
 
 	if (!page)
 		return NULL;
@@ -5236,7 +5237,8 @@ static void *___kmalloc_large_node(size_t size, gfp_t flags, int node)
 	if (node == NUMA_NO_NODE)
 		page = alloc_frozen_pages_noprof(flags, order);
 	else
-		page = __alloc_frozen_pages_noprof(flags, order, node, NULL);
+		page = __alloc_frozen_pages_noprof(flags, order, node, NULL,
+						   ALLOC_DEFAULT);
 
 	if (page) {
 		ptr = page_address(page);

-- 
2.54.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 04/13] mm/page_alloc: relax GFP WARN in nolock allocs
  2026-06-22 10:01 [PATCH v2 00/13] mm: Some cleanups for page allocator APIs Brendan Jackman
                   ` (2 preceding siblings ...)
  2026-06-22 10:01 ` [PATCH v2 03/13] mm/page_alloc: unify __alloc_frozen_pages[_nolock]_noprof() Brendan Jackman
@ 2026-06-22 10:01 ` Brendan Jackman
  2026-06-22 10:01 ` [PATCH v2 05/13] perf/x86/intel: Use higher-level allocator Brendan Jackman
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 10:01 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan, Muchun Song, Oscar Salvador,
	David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Mike Rapoport, Matthew Brost, Joshua Hahn, Rakie Kim,
	Byungchul Park, Ying Huang, Alistair Popple, Hao Li,
	Christoph Lameter, David Rientjes, Roman Gushchin,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt
  Cc: Harry Yoo (Oracle), Gregory Price, Johannes Weiner,
	Alexei Starovoitov, Matthew Wilcox, linux-mm, linux-kernel,
	linux-rt-devel, Brendan Jackman

This WARN forbids setting other flags than __GFP_ACCOUNT but we
unconditionally set the ones in gfp_nolock so they are certainly fine
for the caller to set.

There are other GFP flags that are almost certainly fine to set here;
Willy noted GFP_HIGHMEM, GFP_DMA, GFP_MOVABLE and GFP_HARDWALL. But,
nolock allocation is rather special, so be conservative to try and
ensure we have a chance to think carefully before nontrivial new
usecases arise.

Suggested-by: Matthew Wilcox <willy@infradead.org>
Link: https://lore.kernel.org/linux-mm/ajS96fWbG4dzP3u3@casper.infradead.org/
Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 mm/page_alloc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index e31babe2181a1..074e007bf1bc3 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5337,7 +5337,8 @@ struct page *__alloc_frozen_pages_noprof(gfp_t gfp, unsigned int order,
 		return NULL;
 
 	if (alloc_flags & ALLOC_NOLOCK) {
-		VM_WARN_ON_ONCE(gfp & ~__GFP_ACCOUNT);
+		/* Certain other flags could be supported later if needed. */
+		VM_WARN_ON_ONCE(gfp & ~(__GFP_ACCOUNT | gfp_nolock));
 		if (!alloc_trylock_allowed())
 			return NULL;
 		gfp |= gfp_nolock;

-- 
2.54.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 05/13] perf/x86/intel: Use higher-level allocator
  2026-06-22 10:01 [PATCH v2 00/13] mm: Some cleanups for page allocator APIs Brendan Jackman
                   ` (3 preceding siblings ...)
  2026-06-22 10:01 ` [PATCH v2 04/13] mm/page_alloc: relax GFP WARN in nolock allocs Brendan Jackman
@ 2026-06-22 10:01 ` Brendan Jackman
  2026-06-22 10:10   ` sashiko-bot
  2026-06-22 10:01 ` [PATCH v2 06/13] KVM: VMX: " Brendan Jackman
                   ` (9 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 10:01 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan, Muchun Song, Oscar Salvador,
	David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Mike Rapoport, Matthew Brost, Joshua Hahn, Rakie Kim,
	Byungchul Park, Ying Huang, Alistair Popple, Hao Li,
	Christoph Lameter, David Rientjes, Roman Gushchin,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt
  Cc: Harry Yoo (Oracle), Gregory Price, Johannes Weiner,
	Alexei Starovoitov, Matthew Wilcox, linux-mm, linux-kernel,
	linux-rt-devel, Brendan Jackman, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	James Clark

The difference between __alloc_pages_node() and alloc_pages_node() is
that the former allows you to pass NUMA_NO_NODE.

The former is going away and the latter works fine here so switch over.

Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: James Clark <james.clark@linaro.org>
Assisted-by: Gemini:unknown-version
Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 arch/x86/events/intel/ds.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
index 7f0d515c07c54..bbc20a5beabb6 100644
--- a/arch/x86/events/intel/ds.c
+++ b/arch/x86/events/intel/ds.c
@@ -834,7 +834,7 @@ static void *dsalloc_pages(size_t size, gfp_t flags, int cpu)
 	int node = cpu_to_node(cpu);
 	struct page *page;
 
-	page = __alloc_pages_node(node, flags | __GFP_ZERO, order);
+	page = alloc_pages_node(node, flags | __GFP_ZERO, order);
 	return page ? page_address(page) : NULL;
 }
 
@@ -1090,9 +1090,9 @@ void init_arch_pebs_on_cpu(int cpu)
 
 	/*
 	 * 4KB-aligned pointer of the output buffer
-	 * (__alloc_pages_node() return page aligned address)
+	 * (alloc_pages_node() returns page aligned address)
 	 * Buffer Size = 4KB * 2^SIZE
-	 * contiguous physical buffer (__alloc_pages_node() with order)
+	 * contiguous physical buffer (alloc_pages_node() with order)
 	 */
 	arch_pebs_base = virt_to_phys(cpuc->pebs_vaddr) | PEBS_BUFFER_SHIFT;
 	wrmsr_on_cpu(cpu, MSR_IA32_PEBS_BASE, (u32)arch_pebs_base,

-- 
2.54.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 06/13] KVM: VMX: Use higher-level allocator
  2026-06-22 10:01 [PATCH v2 00/13] mm: Some cleanups for page allocator APIs Brendan Jackman
                   ` (4 preceding siblings ...)
  2026-06-22 10:01 ` [PATCH v2 05/13] perf/x86/intel: Use higher-level allocator Brendan Jackman
@ 2026-06-22 10:01 ` Brendan Jackman
  2026-06-22 10:10   ` sashiko-bot
  2026-06-22 10:01 ` [PATCH v2 07/13] x86/virt: " Brendan Jackman
                   ` (8 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 10:01 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan, Muchun Song, Oscar Salvador,
	David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Mike Rapoport, Matthew Brost, Joshua Hahn, Rakie Kim,
	Byungchul Park, Ying Huang, Alistair Popple, Hao Li,
	Christoph Lameter, David Rientjes, Roman Gushchin,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt
  Cc: Harry Yoo (Oracle), Gregory Price, Johannes Weiner,
	Alexei Starovoitov, Matthew Wilcox, linux-mm, linux-kernel,
	linux-rt-devel, Brendan Jackman, Sean Christopherson,
	Paolo Bonzini, kvm

The difference between __alloc_pages_node() and alloc_pages_node() is
that the former allows you to pass NUMA_NO_NODE.

The former is going away and the latter works fine here so switch over.

Cc: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org
Assisted-by: Gemini:unknown-version
Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 arch/x86/kvm/vmx/vmx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index b9103de01428e..23ba400b30eec 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -2994,7 +2994,7 @@ struct vmcs *alloc_vmcs_cpu(bool shadow, int cpu, gfp_t flags)
 	struct page *pages;
 	struct vmcs *vmcs;
 
-	pages = __alloc_pages_node(node, flags, 0);
+	pages = alloc_pages_node(node, flags, 0);
 	if (!pages)
 		return NULL;
 	vmcs = page_address(pages);

-- 
2.54.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 07/13] x86/virt: Use higher-level allocator
  2026-06-22 10:01 [PATCH v2 00/13] mm: Some cleanups for page allocator APIs Brendan Jackman
                   ` (5 preceding siblings ...)
  2026-06-22 10:01 ` [PATCH v2 06/13] KVM: VMX: " Brendan Jackman
@ 2026-06-22 10:01 ` Brendan Jackman
  2026-06-22 10:12   ` sashiko-bot
  2026-06-22 10:01 ` [PATCH v2 08/13] sgi-xp: " Brendan Jackman
                   ` (7 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 10:01 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan, Muchun Song, Oscar Salvador,
	David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Mike Rapoport, Matthew Brost, Joshua Hahn, Rakie Kim,
	Byungchul Park, Ying Huang, Alistair Popple, Hao Li,
	Christoph Lameter, David Rientjes, Roman Gushchin,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt
  Cc: Harry Yoo (Oracle), Gregory Price, Johannes Weiner,
	Alexei Starovoitov, Matthew Wilcox, linux-mm, linux-kernel,
	linux-rt-devel, Brendan Jackman, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, x86, H. Peter Anvin

The difference between __alloc_pages_node() and alloc_pages_node() is
that the former allows you to pass NUMA_NO_NODE.

The former is going away and the latter works fine here so switch over.

Cc: Thomas Gleixner <tglx@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: x86@kernel.org
Cc: "H. Peter Anvin" <hpa@zytor.com>
Assisted-by: Gemini:unknown-version
Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 arch/x86/virt/hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/virt/hw.c b/arch/x86/virt/hw.c
index f647557d38ac5..4251e410474fc 100644
--- a/arch/x86/virt/hw.c
+++ b/arch/x86/virt/hw.c
@@ -183,7 +183,7 @@ static __init int __x86_vmx_init(void)
 		struct page *page;
 		struct vmcs *vmcs;
 
-		page = __alloc_pages_node(node, GFP_KERNEL | __GFP_ZERO, 0);
+		page = alloc_pages_node(node, GFP_KERNEL | __GFP_ZERO, 0);
 		if (WARN_ON_ONCE(!page)) {
 			x86_vmx_exit();
 			return -ENOMEM;

-- 
2.54.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 08/13] sgi-xp: Use higher-level allocator
  2026-06-22 10:01 [PATCH v2 00/13] mm: Some cleanups for page allocator APIs Brendan Jackman
                   ` (6 preceding siblings ...)
  2026-06-22 10:01 ` [PATCH v2 07/13] x86/virt: " Brendan Jackman
@ 2026-06-22 10:01 ` Brendan Jackman
  2026-06-22 10:15   ` sashiko-bot
  2026-06-22 10:20   ` Greg Kroah-Hartman
  2026-06-22 10:01 ` [PATCH v2 09/13] net/funeth: Switch to " Brendan Jackman
                   ` (6 subsequent siblings)
  14 siblings, 2 replies; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 10:01 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan, Muchun Song, Oscar Salvador,
	David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Mike Rapoport, Matthew Brost, Joshua Hahn, Rakie Kim,
	Byungchul Park, Ying Huang, Alistair Popple, Hao Li,
	Christoph Lameter, David Rientjes, Roman Gushchin,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt
  Cc: Harry Yoo (Oracle), Gregory Price, Johannes Weiner,
	Alexei Starovoitov, Matthew Wilcox, linux-mm, linux-kernel,
	linux-rt-devel, Brendan Jackman, Robin Holt, Steve Wahl,
	Arnd Bergmann, Greg Kroah-Hartman

The difference between __alloc_pages_node() and alloc_pages_node() is
that the former allows you to pass NUMA_NO_NODE.

The former is going away and the latter works fine here so switch over.

Cc: Robin Holt <robinmholt@gmail.com>
Cc: Steve Wahl <steve.wahl@hpe.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Assisted-by: Gemini:unknown-model
Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 drivers/misc/sgi-xp/xpc_uv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c
index 772c787268932..aacff70204241 100644
--- a/drivers/misc/sgi-xp/xpc_uv.c
+++ b/drivers/misc/sgi-xp/xpc_uv.c
@@ -170,7 +170,7 @@ xpc_create_gru_mq_uv(unsigned int mq_size, int cpu, char *irq_name,
 	mq->mmr_blade = uv_cpu_to_blade_id(cpu);
 
 	nid = cpu_to_node(cpu);
-	page = __alloc_pages_node(nid,
+	page = alloc_pages_node(nid,
 				      GFP_KERNEL | __GFP_ZERO | __GFP_THISNODE,
 				      pg_order);
 	if (page == NULL) {

-- 
2.54.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 09/13] net/funeth: Switch to higher-level allocator
  2026-06-22 10:01 [PATCH v2 00/13] mm: Some cleanups for page allocator APIs Brendan Jackman
                   ` (7 preceding siblings ...)
  2026-06-22 10:01 ` [PATCH v2 08/13] sgi-xp: " Brendan Jackman
@ 2026-06-22 10:01 ` Brendan Jackman
  2026-06-22 10:11   ` sashiko-bot
  2026-06-22 10:01 ` [PATCH v2 10/13] mm: Remove __alloc_pages_node() Brendan Jackman
                   ` (5 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 10:01 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan, Muchun Song, Oscar Salvador,
	David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Mike Rapoport, Matthew Brost, Joshua Hahn, Rakie Kim,
	Byungchul Park, Ying Huang, Alistair Popple, Hao Li,
	Christoph Lameter, David Rientjes, Roman Gushchin,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt
  Cc: Harry Yoo (Oracle), Gregory Price, Johannes Weiner,
	Alexei Starovoitov, Matthew Wilcox, linux-mm, linux-kernel,
	linux-rt-devel, Brendan Jackman, Dimitris Michailidis,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni

The difference between __alloc_pages_node() and alloc_pages_node() is
that the former allows you to pass NUMA_NO_NODE.

The former is going away and the latter works fine here so switch over.

Cc: Dimitris Michailidis <dmichail@fungible.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Assisted-by: Gemini:unknown-version
Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 drivers/net/ethernet/fungible/funeth/funeth_rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/fungible/funeth/funeth_rx.c b/drivers/net/ethernet/fungible/funeth/funeth_rx.c
index 7e2584895de39..d7000017ac2bd 100644
--- a/drivers/net/ethernet/fungible/funeth/funeth_rx.c
+++ b/drivers/net/ethernet/fungible/funeth/funeth_rx.c
@@ -103,7 +103,7 @@ static int funeth_alloc_page(struct funeth_rxq *q, struct funeth_rxbuf *rb,
 	if (cache_get(q, rb))
 		return 0;
 
-	p = __alloc_pages_node(node, gfp | __GFP_NOWARN, 0);
+	p = alloc_pages_node(node, gfp | __GFP_NOWARN, 0);
 	if (unlikely(!p))
 		return -ENOMEM;
 

-- 
2.54.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 10/13] mm: Remove __alloc_pages_node()
  2026-06-22 10:01 [PATCH v2 00/13] mm: Some cleanups for page allocator APIs Brendan Jackman
                   ` (8 preceding siblings ...)
  2026-06-22 10:01 ` [PATCH v2 09/13] net/funeth: Switch to " Brendan Jackman
@ 2026-06-22 10:01 ` Brendan Jackman
  2026-06-22 10:17   ` sashiko-bot
  2026-06-22 10:01 ` [PATCH v2 11/13] alloc_tag: Move to mm/ Brendan Jackman
                   ` (4 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 10:01 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan, Muchun Song, Oscar Salvador,
	David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Mike Rapoport, Matthew Brost, Joshua Hahn, Rakie Kim,
	Byungchul Park, Ying Huang, Alistair Popple, Hao Li,
	Christoph Lameter, David Rientjes, Roman Gushchin,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt
  Cc: Harry Yoo (Oracle), Gregory Price, Johannes Weiner,
	Alexei Starovoitov, Matthew Wilcox, linux-mm, linux-kernel,
	linux-rt-devel, Brendan Jackman

There were only a few users, which have been removed. The only advantage
of this API over alloc_pages_node() is avoiding a single conditional
branch. The disadvantages are:

1. More API surface, more sources of confusion, more maintenance.

2. Worse impact of CPU hotplug bugs: most users of __alloc_pages_node()
   were using the result of cpu_to_node(); if the CPU gets hotplugged
   out this will return NUMA_NO_NODE. If one of these paths fails to
   protect against a concurrent hotplug then page_alloc.c will use
   NUMA_NO_NODE as an index into NODE_DATA() and cause some horrible
   memory corruption or other. With alloc_pages_node(), the code might
   just work fine.

Ulterior motive: this frees up the __* variants of the allocator APIs to
serve specifically for use as mm-internal API.

Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 include/linux/gfp.h | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index cdf95a9f0b87c..7edcc2e0be9ce 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -278,21 +278,6 @@ static inline void warn_if_node_offline(int this_node, gfp_t gfp_mask)
 	dump_stack();
 }
 
-/*
- * Allocate pages, preferring the node given as nid. The node must be valid and
- * online. For more general interface, see alloc_pages_node().
- */
-static inline struct page *
-__alloc_pages_node_noprof(int nid, gfp_t gfp_mask, unsigned int order)
-{
-	VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES);
-	warn_if_node_offline(nid, gfp_mask);
-
-	return __alloc_pages_noprof(gfp_mask, order, nid, NULL);
-}
-
-#define  __alloc_pages_node(...)		alloc_hooks(__alloc_pages_node_noprof(__VA_ARGS__))
-
 static inline
 struct folio *__folio_alloc_node_noprof(gfp_t gfp, unsigned int order, int nid)
 {
@@ -315,7 +300,10 @@ static inline struct page *alloc_pages_node_noprof(int nid, gfp_t gfp_mask,
 	if (nid == NUMA_NO_NODE)
 		nid = numa_mem_id();
 
-	return __alloc_pages_node_noprof(nid, gfp_mask, order);
+	VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES);
+	warn_if_node_offline(nid, gfp_mask);
+
+	return __alloc_pages_noprof(gfp_mask, order, nid, NULL);
 }
 
 #define  alloc_pages_node(...)			alloc_hooks(alloc_pages_node_noprof(__VA_ARGS__))

-- 
2.54.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 11/13] alloc_tag: Move to mm/
  2026-06-22 10:01 [PATCH v2 00/13] mm: Some cleanups for page allocator APIs Brendan Jackman
                   ` (9 preceding siblings ...)
  2026-06-22 10:01 ` [PATCH v2 10/13] mm: Remove __alloc_pages_node() Brendan Jackman
@ 2026-06-22 10:01 ` Brendan Jackman
  2026-06-22 10:01 ` [PATCH v2 12/13] mm: Move __alloc_pages() to mm/internal.h Brendan Jackman
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 10:01 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan, Muchun Song, Oscar Salvador,
	David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Mike Rapoport, Matthew Brost, Joshua Hahn, Rakie Kim,
	Byungchul Park, Ying Huang, Alistair Popple, Hao Li,
	Christoph Lameter, David Rientjes, Roman Gushchin,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt
  Cc: Harry Yoo (Oracle), Gregory Price, Johannes Weiner,
	Alexei Starovoitov, Matthew Wilcox, linux-mm, linux-kernel,
	linux-rt-devel, Brendan Jackman

This is logically mm code. Moving to mm/ allows access to mm/internal.h

Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 MAINTAINERS             | 2 +-
 lib/Makefile            | 1 -
 mm/Makefile             | 1 +
 {lib => mm}/alloc_tag.c | 0
 4 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 65bd4328fe056..5d426b79b8fe7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -16713,7 +16713,7 @@ S:	Maintained
 F:	Documentation/mm/allocation-profiling.rst
 F:	include/linux/alloc_tag.h
 F:	include/linux/pgalloc_tag.h
-F:	lib/alloc_tag.c
+F:	mm/alloc_tag.c
 
 MEMORY CONTROLLER DRIVERS
 M:	Krzysztof Kozlowski <krzk@kernel.org>
diff --git a/lib/Makefile b/lib/Makefile
index f33a24bf1c19a..44f6538533a97 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -197,7 +197,6 @@ obj-$(CONFIG_OF_RECONFIG_NOTIFIER_ERROR_INJECT) += \
 obj-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
 
 obj-$(CONFIG_CODE_TAGGING) += codetag.o
-obj-$(CONFIG_MEM_ALLOC_PROFILING) += alloc_tag.o
 
 lib-$(CONFIG_GENERIC_BUG) += bug.o
 
diff --git a/mm/Makefile b/mm/Makefile
index eff9f9e7e061c..4fc713867b9bd 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -147,3 +147,4 @@ obj-$(CONFIG_SHRINKER_DEBUG) += shrinker_debug.o
 obj-$(CONFIG_EXECMEM) += execmem.o
 obj-$(CONFIG_TMPFS_QUOTA) += shmem_quota.o
 obj-$(CONFIG_LAZY_MMU_MODE_KUNIT_TEST) += tests/lazy_mmu_mode_kunit.o
+obj-$(CONFIG_MEM_ALLOC_PROFILING) += alloc_tag.o
diff --git a/lib/alloc_tag.c b/mm/alloc_tag.c
similarity index 100%
rename from lib/alloc_tag.c
rename to mm/alloc_tag.c

-- 
2.54.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 12/13] mm: Move __alloc_pages() to mm/internal.h
  2026-06-22 10:01 [PATCH v2 00/13] mm: Some cleanups for page allocator APIs Brendan Jackman
                   ` (10 preceding siblings ...)
  2026-06-22 10:01 ` [PATCH v2 11/13] alloc_tag: Move to mm/ Brendan Jackman
@ 2026-06-22 10:01 ` Brendan Jackman
  2026-06-22 10:21   ` sashiko-bot
  2026-06-22 12:24   ` David Hildenbrand (Arm)
  2026-06-22 10:01 ` [PATCH v2 13/13] mm: remove __GFP_NO_CODETAG Brendan Jackman
                   ` (2 subsequent siblings)
  14 siblings, 2 replies; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 10:01 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan, Muchun Song, Oscar Salvador,
	David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Mike Rapoport, Matthew Brost, Joshua Hahn, Rakie Kim,
	Byungchul Park, Ying Huang, Alistair Popple, Hao Li,
	Christoph Lameter, David Rientjes, Roman Gushchin,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt
  Cc: Harry Yoo (Oracle), Gregory Price, Johannes Weiner,
	Alexei Starovoitov, Matthew Wilcox, linux-mm, linux-kernel,
	linux-rt-devel, Brendan Jackman

It's no longer used outside of mm/.

Since this means __alloc_pages_noprof() is no longer visible from gfp.h,
this also means moving the definition of alloc_pages_node_noprof into
the .c file.

Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 Documentation/admin-guide/cgroup-v1/cpusets.rst |  2 +-
 Documentation/admin-guide/mm/transhuge.rst      |  2 +-
 include/linux/gfp.h                             | 16 +---------------
 mm/internal.h                                   |  4 ++++
 mm/page_alloc.c                                 | 11 +++++++++++
 5 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/Documentation/admin-guide/cgroup-v1/cpusets.rst b/Documentation/admin-guide/cgroup-v1/cpusets.rst
index c7909e5ac1361..52a213aff04e5 100644
--- a/Documentation/admin-guide/cgroup-v1/cpusets.rst
+++ b/Documentation/admin-guide/cgroup-v1/cpusets.rst
@@ -284,7 +284,7 @@ take action.
 ==>
     Unless this feature is enabled by writing "1" to the special file
     /dev/cpuset/memory_pressure_enabled, the hook in the rebalance
-    code of __alloc_pages() for this metric reduces to simply noticing
+    code of the page allocator for this metric reduces to simply noticing
     that the cpuset_memory_pressure_enabled flag is zero.  So only
     systems that enable this feature will compute the metric.
 
diff --git a/Documentation/admin-guide/mm/transhuge.rst b/Documentation/admin-guide/mm/transhuge.rst
index 23f8d13c2629d..16f37135ed80d 100644
--- a/Documentation/admin-guide/mm/transhuge.rst
+++ b/Documentation/admin-guide/mm/transhuge.rst
@@ -761,7 +761,7 @@ compact_fail
 	but failed.
 
 It is possible to establish how long the stalls were using the function
-tracer to record how long was spent in __alloc_pages() and
+tracer to record how long was spent in the page allocator and
 using the mm_page_alloc tracepoint to identify which allocations were
 for huge pages.
 
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 7edcc2e0be9ce..9656a62138917 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -226,10 +226,6 @@ static inline void arch_free_page(struct page *page, int order) { }
 static inline void arch_alloc_page(struct page *page, int order) { }
 #endif
 
-struct page *__alloc_pages_noprof(gfp_t gfp, unsigned int order, int preferred_nid,
-		nodemask_t *nodemask);
-#define __alloc_pages(...)			alloc_hooks(__alloc_pages_noprof(__VA_ARGS__))
-
 struct folio *__folio_alloc_noprof(gfp_t gfp, unsigned int order, int preferred_nid,
 		nodemask_t *nodemask);
 #define __folio_alloc(...)			alloc_hooks(__folio_alloc_noprof(__VA_ARGS__))
@@ -294,17 +290,7 @@ struct folio *__folio_alloc_node_noprof(gfp_t gfp, unsigned int order, int nid)
  * prefer the current CPU's closest node. Otherwise node must be valid and
  * online.
  */
-static inline struct page *alloc_pages_node_noprof(int nid, gfp_t gfp_mask,
-						   unsigned int order)
-{
-	if (nid == NUMA_NO_NODE)
-		nid = numa_mem_id();
-
-	VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES);
-	warn_if_node_offline(nid, gfp_mask);
-
-	return __alloc_pages_noprof(gfp_mask, order, nid, NULL);
-}
+struct page *alloc_pages_node_noprof(int nid, gfp_t gfp_mask, unsigned int order);
 
 #define  alloc_pages_node(...)			alloc_hooks(alloc_pages_node_noprof(__VA_ARGS__))
 
diff --git a/mm/internal.h b/mm/internal.h
index 6bc89ec62e527..0847b55bfc147 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -1955,4 +1955,8 @@ static inline int get_sysctl_max_map_count(void)
 bool may_expand_vm(struct mm_struct *mm, const vma_flags_t *vma_flags,
 		   unsigned long npages);
 
+struct page *__alloc_pages_noprof(gfp_t gfp, unsigned int order, int preferred_nid,
+		nodemask_t *nodemask);
+#define __alloc_pages(...)			alloc_hooks(__alloc_pages_noprof(__VA_ARGS__))
+
 #endif	/* __MM_INTERNAL_H */
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 074e007bf1bc3..d99e4ea8307ea 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5410,6 +5410,17 @@ struct page *__alloc_pages_noprof(gfp_t gfp, unsigned int order,
 }
 EXPORT_SYMBOL(__alloc_pages_noprof);
 
+struct page *alloc_pages_node_noprof(int nid, gfp_t gfp_mask, unsigned int order)
+{
+	if (nid == NUMA_NO_NODE)
+		nid = numa_mem_id();
+
+	VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES);
+	warn_if_node_offline(nid, gfp_mask);
+
+	return __alloc_pages_noprof(gfp_mask, order, nid, NULL);
+}
+
 struct folio *__folio_alloc_noprof(gfp_t gfp, unsigned int order, int preferred_nid,
 		nodemask_t *nodemask)
 {

-- 
2.54.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 13/13] mm: remove __GFP_NO_CODETAG
  2026-06-22 10:01 [PATCH v2 00/13] mm: Some cleanups for page allocator APIs Brendan Jackman
                   ` (11 preceding siblings ...)
  2026-06-22 10:01 ` [PATCH v2 12/13] mm: Move __alloc_pages() to mm/internal.h Brendan Jackman
@ 2026-06-22 10:01 ` Brendan Jackman
  2026-06-22 10:05 ` [PATCH v2 00/13] mm: Some cleanups for page allocator APIs Vlastimil Babka (SUSE)
  2026-06-22 13:08 ` Lorenzo Stoakes
  14 siblings, 0 replies; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 10:01 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan, Muchun Song, Oscar Salvador,
	David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Mike Rapoport, Matthew Brost, Joshua Hahn, Rakie Kim,
	Byungchul Park, Ying Huang, Alistair Popple, Hao Li,
	Christoph Lameter, David Rientjes, Roman Gushchin,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt
  Cc: Harry Yoo (Oracle), Gregory Price, Johannes Weiner,
	Alexei Starovoitov, Matthew Wilcox, linux-mm, linux-kernel,
	linux-rt-devel, Brendan Jackman

Now that alloc_pages has an entrypoint that allows passing alloc_flags,
we can take advantage of this to start removing GFP flags that are only
used for mm-internal stuff.

This requires also plumbing the alloc_flags into some more of the
allocator code, in particular __alloc_pages[_noprof]() gets an
alloc_flags arg to go along with its callees, and we now need to pass
those flags deeper into the allocator so they can reach the alloc_tag
code.

To try and keep the new ALLOC_NO_CODETAG's scope nice and narrow, don't
define it in mm/internal.h, instead just define a "reserved bit" and
then use that in places that don't care about what it means.

Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 mm/alloc_tag.c       | 18 ++++++++++--------
 mm/compaction.c      |  4 ++--
 mm/internal.h        |  8 ++++++--
 mm/page_alloc.c      | 42 ++++++++++++++++++++++++------------------
 mm/page_frag_cache.c |  4 ++--
 5 files changed, 44 insertions(+), 32 deletions(-)

diff --git a/mm/alloc_tag.c b/mm/alloc_tag.c
index d9be1cf5187d9..61a6cba32ff35 100644
--- a/mm/alloc_tag.c
+++ b/mm/alloc_tag.c
@@ -15,6 +15,8 @@
 #include <linux/vmalloc.h>
 #include <linux/kmemleak.h>
 
+#include "internal.h"
+
 #define ALLOCINFO_FILE_NAME		"allocinfo"
 #define MODULE_ALLOC_TAG_VMAP_SIZE	(100000UL * sizeof(struct alloc_tag))
 #define SECTION_START(NAME)		(CODETAG_SECTION_START_PREFIX NAME)
@@ -785,16 +787,15 @@ struct pfn_pool {
 					 sizeof(unsigned long))
 
 /*
- * Skip early PFN recording for a page allocation.  Reuses the
- * %__GFP_NO_OBJ_EXT bit.  Used by __alloc_tag_add_early_pfn() to avoid
- * recursion when allocating pages for the early PFN tracking list
- * itself.
+ * Skip early PFN recording for a page allocation.  Used by
+ * __alloc_tag_add_early_pfn() to avoid recursion when allocating pages for the
+ * early PFN tracking list itself.
  *
  * Codetags of the pages allocated with __GFP_NO_CODETAG should be
  * cleared (via clear_page_tag_ref()) before freeing the pages to prevent
  * alloc_tag_sub_check() from triggering a warning.
  */
-#define __GFP_NO_CODETAG		__GFP_NO_OBJ_EXT
+#define ALLOC_NO_CODETAG		__ALLOC_ALLOC_TAG
 
 static struct pfn_pool *current_pfn_pool __initdata;
 
@@ -806,7 +807,8 @@ static void __init __alloc_tag_add_early_pfn(unsigned long pfn)
 	do {
 		pool = READ_ONCE(current_pfn_pool);
 		if (!pool || atomic_read(&pool->count) >= PFN_POOL_SIZE) {
-			struct page *new_page = alloc_page(__GFP_HIGH | __GFP_NO_CODETAG);
+			struct page *new_page = __alloc_pages(__GFP_HIGH, 0, numa_mem_id(),
+							      NULL, ALLOC_NO_CODETAG);
 			struct pfn_pool *new;
 
 			if (!new_page) {
@@ -837,7 +839,7 @@ typedef void alloc_tag_add_func(unsigned long pfn);
 static alloc_tag_add_func __rcu *alloc_tag_add_early_pfn_ptr __refdata =
 	RCU_INITIALIZER(__alloc_tag_add_early_pfn);
 
-void alloc_tag_add_early_pfn(unsigned long pfn, gfp_t gfp_flags)
+void alloc_tag_add_early_pfn(unsigned long pfn, unsigned int alloc_flags)
 {
 	alloc_tag_add_func *alloc_tag_add;
 
@@ -845,7 +847,7 @@ void alloc_tag_add_early_pfn(unsigned long pfn, gfp_t gfp_flags)
 		return;
 
 	/* Skip allocations for the tracking list itself to avoid recursion. */
-	if (gfp_flags & __GFP_NO_CODETAG)
+	if (alloc_flags & ALLOC_NO_CODETAG)
 		return;
 
 	rcu_read_lock();
diff --git a/mm/compaction.c b/mm/compaction.c
index b776f35ad0200..e90ebd2c54f48 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -82,7 +82,7 @@ static inline bool is_via_compact_memory(int order) { return false; }
 
 static struct page *mark_allocated_noprof(struct page *page, unsigned int order, gfp_t gfp_flags)
 {
-	post_alloc_hook(page, order, __GFP_MOVABLE);
+	post_alloc_hook(page, order, __GFP_MOVABLE, ALLOC_DEFAULT);
 	set_page_refcounted(page);
 	return page;
 }
@@ -1850,7 +1850,7 @@ static struct folio *compaction_alloc_noprof(struct folio *src, unsigned long da
 	}
 	dst = (struct folio *)freepage;
 
-	post_alloc_hook(&dst->page, order, __GFP_MOVABLE);
+	post_alloc_hook(&dst->page, order, __GFP_MOVABLE, ALLOC_DEFAULT);
 	set_page_refcounted(&dst->page);
 	if (order)
 		prep_compound_page(&dst->page, order);
diff --git a/mm/internal.h b/mm/internal.h
index 0847b55bfc147..a45bedb9ada5f 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -684,6 +684,8 @@ struct alloc_context {
 	 */
 	enum zone_type highest_zoneidx;
 	bool spread_dirty_pages;
+	/* Only flags that are global to the whole allocation go here. */
+	unsigned int alloc_flags;
 };
 
 /*
@@ -907,7 +909,8 @@ static inline void init_compound_tail(struct page *tail,
 	prep_compound_tail(tail, head, order);
 }
 
-void post_alloc_hook(struct page *page, unsigned int order, gfp_t gfp_flags);
+void post_alloc_hook(struct page *page, unsigned int order, gfp_t gfp_flags,
+		     unsigned int alloc_flags);
 extern bool free_pages_prepare(struct page *page, unsigned int order);
 
 extern int user_min_free_kbytes;
@@ -1481,6 +1484,7 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,
 #define ALLOC_HIGHATOMIC	0x200 /* Allows access to MIGRATE_HIGHATOMIC */
 #define ALLOC_NOLOCK		0x400 /* Only use spin_trylock in allocation path */
 #define ALLOC_KSWAPD		0x800 /* allow waking of kswapd, __GFP_KSWAPD_RECLAIM set */
+#define __ALLOC_ALLOC_TAG      0x1000 /* Reserved bit for use by alloc_tag code */
 
 /* Flags that allow allocations below the min watermark. */
 #define ALLOC_RESERVES (ALLOC_NON_BLOCK|ALLOC_MIN_RESERVE|ALLOC_HIGHATOMIC|ALLOC_OOM)
@@ -1956,7 +1960,7 @@ bool may_expand_vm(struct mm_struct *mm, const vma_flags_t *vma_flags,
 		   unsigned long npages);
 
 struct page *__alloc_pages_noprof(gfp_t gfp, unsigned int order, int preferred_nid,
-		nodemask_t *nodemask);
+		nodemask_t *nodemask, unsigned int alloc_flags);
 #define __alloc_pages(...)			alloc_hooks(__alloc_pages_noprof(__VA_ARGS__))
 
 #endif	/* __MM_INTERNAL_H */
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index d99e4ea8307ea..d50fd9c77a2e8 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1246,7 +1246,7 @@ void __clear_page_tag_ref(struct page *page)
 /* Should be called only if mem_alloc_profiling_enabled() */
 static noinline
 void __pgalloc_tag_add(struct page *page, struct task_struct *task,
-		       unsigned int nr, gfp_t gfp_flags)
+		       unsigned int nr, unsigned int alloc_flags)
 {
 	union pgtag_ref_handle handle;
 	union codetag_ref ref;
@@ -1260,17 +1260,17 @@ void __pgalloc_tag_add(struct page *page, struct task_struct *task,
 		 * page_ext is not available yet, record the pfn so we can
 		 * clear the tag ref later when page_ext is initialized.
 		 */
-		alloc_tag_add_early_pfn(page_to_pfn(page), gfp_flags);
+		alloc_tag_add_early_pfn(page_to_pfn(page), alloc_flags);
 		if (task->alloc_tag)
 			alloc_tag_set_inaccurate(task->alloc_tag);
 	}
 }
 
 static inline void pgalloc_tag_add(struct page *page, struct task_struct *task,
-				   unsigned int nr, gfp_t gfp_flags)
+				   unsigned int nr, unsigned int alloc_flags)
 {
 	if (mem_alloc_profiling_enabled())
-		__pgalloc_tag_add(page, task, nr, gfp_flags);
+		__pgalloc_tag_add(page, task, nr, alloc_flags);
 }
 
 /* Should be called only if mem_alloc_profiling_enabled() */
@@ -1807,7 +1807,7 @@ static inline bool should_skip_init(gfp_t flags)
 }
 
 inline void post_alloc_hook(struct page *page, unsigned int order,
-				gfp_t gfp_flags)
+				gfp_t gfp_flags, unsigned int alloc_flags)
 {
 	const bool zero_tags = gfp_flags & __GFP_ZEROTAGS;
 	bool init = !want_init_on_free() && want_init_on_alloc(gfp_flags) &&
@@ -1858,13 +1858,13 @@ inline void post_alloc_hook(struct page *page, unsigned int order,
 
 	set_page_owner(page, order, gfp_flags);
 	page_table_check_alloc(page, order);
-	pgalloc_tag_add(page, current, 1 << order, gfp_flags);
+	pgalloc_tag_add(page, current, 1 << order, alloc_flags);
 }
 
 static void prep_new_page(struct page *page, unsigned int order, gfp_t gfp_flags,
 							unsigned int alloc_flags)
 {
-	post_alloc_hook(page, order, gfp_flags);
+	post_alloc_hook(page, order, gfp_flags, alloc_flags);
 
 	if (order && (gfp_flags & __GFP_COMP))
 		prep_compound_page(page, order);
@@ -4773,8 +4773,12 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
 	 * The fast path uses conservative alloc_flags to succeed only until
 	 * kswapd needs to be woken up, and to avoid the cost of setting up
 	 * alloc_flags precisely. So we do that now.
+	 *
+	 * Can't just or alloc_flags if it contains WMARK bits, but those flags
+	 * shouldn't be set in ac->alloc_flags.
 	 */
-	alloc_flags = slowpath_alloc_flags(gfp_mask, order);
+	VM_WARN_ON(ac->alloc_flags & ALLOC_WMARK_MASK);
+	alloc_flags = ac->alloc_flags | slowpath_alloc_flags(gfp_mask, order);
 
 	/*
 	 * We need to recalculate the starting point for the zonelist iterator
@@ -4816,7 +4820,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
 	reserve_flags = __gfp_pfmemalloc_flags(gfp_mask);
 	if (reserve_flags)
 		alloc_flags = cma_alloc_flags(gfp_mask, reserve_flags) |
-					  (alloc_flags & ALLOC_KSWAPD);
+				ac->alloc_flags | (alloc_flags & ALLOC_KSWAPD);
 
 	/*
 	 * Reset the nodemask and zonelist iterators if memory policies can be
@@ -5218,7 +5222,7 @@ unsigned long alloc_pages_bulk_noprof(gfp_t gfp, int preferred_nid,
 	return nr_populated;
 
 failed:
-	page = __alloc_pages_noprof(gfp, 0, preferred_nid, nodemask);
+	page = __alloc_pages_noprof(gfp, 0, preferred_nid, nodemask, ALLOC_DEFAULT);
 	if (page)
 		page_array[nr_populated++] = page;
 	goto out;
@@ -5326,11 +5330,13 @@ struct page *__alloc_frozen_pages_noprof(gfp_t gfp, unsigned int order,
 {
 	struct page *page;
 	gfp_t alloc_gfp; /* The gfp_t that was actually used for allocation */
-	struct alloc_context ac = { };
+	struct alloc_context ac = {
+		.alloc_flags = alloc_flags,
+	};
 	unsigned int fastpath_alloc_flags = alloc_flags;
 
 	/* Other flags could be supported later if needed. */
-	if (WARN_ON(alloc_flags & ~ALLOC_NOLOCK))
+	if (WARN_ON(alloc_flags & ~(ALLOC_NOLOCK | __ALLOC_ALLOC_TAG)))
 		return NULL;
 
 	if (!alloc_order_allowed(gfp, order, alloc_flags))
@@ -5398,12 +5404,12 @@ struct page *__alloc_frozen_pages_noprof(gfp_t gfp, unsigned int order,
 EXPORT_SYMBOL(__alloc_frozen_pages_noprof);
 
 struct page *__alloc_pages_noprof(gfp_t gfp, unsigned int order,
-		int preferred_nid, nodemask_t *nodemask)
+		int preferred_nid, nodemask_t *nodemask, unsigned int alloc_flags)
 {
 	struct page *page;
 
 	page = __alloc_frozen_pages_noprof(gfp, order, preferred_nid, nodemask,
-					   ALLOC_DEFAULT);
+					   alloc_flags);
 	if (page)
 		set_page_refcounted(page);
 	return page;
@@ -5418,14 +5424,14 @@ struct page *alloc_pages_node_noprof(int nid, gfp_t gfp_mask, unsigned int order
 	VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES);
 	warn_if_node_offline(nid, gfp_mask);
 
-	return __alloc_pages_noprof(gfp_mask, order, nid, NULL);
+	return __alloc_pages_noprof(gfp_mask, order, nid, NULL, ALLOC_DEFAULT);
 }
 
 struct folio *__folio_alloc_noprof(gfp_t gfp, unsigned int order, int preferred_nid,
 		nodemask_t *nodemask)
 {
 	struct page *page = __alloc_pages_noprof(gfp | __GFP_COMP, order,
-					preferred_nid, nodemask);
+					preferred_nid, nodemask, ALLOC_DEFAULT);
 	return page_rmappable_folio(page);
 }
 EXPORT_SYMBOL(__folio_alloc_noprof);
@@ -7107,7 +7113,7 @@ static void split_free_frozen_pages(struct list_head *list, gfp_t gfp_mask)
 		list_for_each_entry_safe(page, next, &list[order], lru) {
 			int i;
 
-			post_alloc_hook(page, order, gfp_mask);
+			post_alloc_hook(page, order, gfp_mask, ALLOC_DEFAULT);
 			if (!order)
 				continue;
 
@@ -7312,7 +7318,7 @@ int alloc_contig_frozen_range_noprof(unsigned long start, unsigned long end,
 		struct page *head = pfn_to_page(start);
 
 		check_new_pages(head, order);
-		prep_new_page(head, order, gfp_mask, 0);
+		prep_new_page(head, order, gfp_mask, ALLOC_DEFAULT);
 	} else {
 		ret = -EINVAL;
 		WARN(true, "PFN range: requested [%lu, %lu), allocated [%lu, %lu)\n",
diff --git a/mm/page_frag_cache.c b/mm/page_frag_cache.c
index d2423f30577e4..d9573170e0719 100644
--- a/mm/page_frag_cache.c
+++ b/mm/page_frag_cache.c
@@ -57,10 +57,10 @@ static struct page *__page_frag_cache_refill(struct page_frag_cache *nc,
 	gfp_mask = (gfp_mask & ~__GFP_DIRECT_RECLAIM) |  __GFP_COMP |
 		   __GFP_NOWARN | __GFP_NORETRY | __GFP_NOMEMALLOC;
 	page = __alloc_pages(gfp_mask, PAGE_FRAG_CACHE_MAX_ORDER,
-			     numa_mem_id(), NULL);
+			     numa_mem_id(), NULL, ALLOC_DEFAULT);
 #endif
 	if (unlikely(!page)) {
-		page = __alloc_pages(gfp, 0, numa_mem_id(), NULL);
+		page = __alloc_pages(gfp, 0, numa_mem_id(), NULL, ALLOC_DEFAULT);
 		order = 0;
 	}
 

-- 
2.54.0


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 00/13] mm: Some cleanups for page allocator APIs
  2026-06-22 10:01 [PATCH v2 00/13] mm: Some cleanups for page allocator APIs Brendan Jackman
                   ` (12 preceding siblings ...)
  2026-06-22 10:01 ` [PATCH v2 13/13] mm: remove __GFP_NO_CODETAG Brendan Jackman
@ 2026-06-22 10:05 ` Vlastimil Babka (SUSE)
  2026-06-22 13:08 ` Lorenzo Stoakes
  14 siblings, 0 replies; 34+ messages in thread
From: Vlastimil Babka (SUSE) @ 2026-06-22 10:05 UTC (permalink / raw)
  To: Brendan Jackman, Andrew Morton, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan, Muchun Song, Oscar Salvador,
	David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Mike Rapoport, Matthew Brost, Joshua Hahn, Rakie Kim,
	Byungchul Park, Ying Huang, Alistair Popple, Hao Li,
	Christoph Lameter, David Rientjes, Roman Gushchin,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt, Hao Ge
  Cc: Harry Yoo (Oracle), Gregory Price, Alexei Starovoitov,
	Matthew Wilcox, linux-mm, linux-kernel, linux-rt-devel,
	Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, James Clark, Sean Christopherson,
	Paolo Bonzini, kvm, Thomas Gleixner, Borislav Petkov, Dave Hansen,
	x86, H. Peter Anvin, Robin Holt, Steve Wahl, Arnd Bergmann,
	Greg Kroah-Hartman, Dimitris Michailidis, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni

+Cc Hao Ge for the "remove __GFP_NO_CODETAG" part

On 6/22/26 12:01, Brendan Jackman wrote:
> Some tweaks and cleanups for page allocator entrypoint and flags. This
> is motivated by preparation for __GFP_UNMAPPED [1] (which will probably
> become ALLOC_UNMAPPED in its next iteration), but all this is supposed
> to be an improvement to the codebase in its own right: unifying code
> paths, reducing API surface, and removing GFP flags.
> 
> [1] https://lore.kernel.org/all/20260320-page_alloc-unmapped-v2-0-28bf1bd54f41@google.com/
> 
> This started with unifying  __alloc_frozen_pages[_nolock]_noprof() and
> expanded from there.
> 
> Unifying the nolock allocator entrypoint with the normal allocator
> entrypoint means adding an alloc_flags argument to the later (only
> exposed within mm/). This presents an opportunity to take advantage of
> that arg to remove some GFP flags, if we add that alloc_flags arg a bit
> more broadly to allocator entrypoints.
> 
> To distinguish between mm-internal and "public" allocator entrypoints,
> it makes sense to use the __ prefix. There are already some public APIs
> with that prefix. For *alloc_pages*, just removing those variants seems
> like a nice cleanup anyway, so do that. For get_free_pages, the "__"
> variant is the _only_ variant and it's very widely used, so it doesn't
> seem worthwhile to modify that. Therefore, scope this "__" change
> specifically to the *alloc_pages* API, which means we leave the
> *folio_alloc* API untouched too, even though that could probably be
> cleaned up if so desired.
> 
> Tested:
> 
> - KVM, mm, and BPF selftests in a QEMU VM
> 
> - kunit.py on x86_64
> 
> - For the ALLOC_NO_CODETAG bits I just booted a VM and read
>   /proc/allocinfo. I confirmed that if I remove ALLOC_NO_CODETAG, the
>   kernel crashes in early boot, so I was at least booting code that
>   depends on this logic.
> 
> I used Google's internal version of Antigravity (AI coding harness) to
> do the repetitive bits, those commits are marked with Assisted-by, the
> rest is manual.
> 
> Signed-off-by: Brendan Jackman <jackmanb@google.com>
> ---
> Changes in v2:
> - Fixed up whitespace in nolock unification patch
> - Introduced ALLOC_DEFAULT to replace literal 0 for alloc_flags
> - All other patches are new
> - Link to v1: https://patch.msgid.link/20260617-alloc-trylock-v1-1-83fd7858832e@google.com
> 
> ---
> Brendan Jackman (13):
>       mm/page_alloc: rename ALLOC_TRYLOCK -> ALLOC_NOLOCK
>       mm/page_alloc: some renames to clarify alloc_flags scopes
>       mm/page_alloc: unify __alloc_frozen_pages[_nolock]_noprof()
>       mm/page_alloc: relax GFP WARN in nolock allocs
>       perf/x86/intel: Use higher-level allocator
>       KVM: VMX: Use higher-level allocator
>       x86/virt: Use higher-level allocator
>       sgi-xp: Use higher-level allocator
>       net/funeth: Switch to higher-level allocator
>       mm: Remove __alloc_pages_node()
>       alloc_tag: Move to mm/
>       mm: Move __alloc_pages() to mm/internal.h
>       mm: remove __GFP_NO_CODETAG
> 
>  Documentation/admin-guide/cgroup-v1/cpusets.rst  |   2 +-
>  Documentation/admin-guide/mm/transhuge.rst       |   2 +-
>  MAINTAINERS                                      |   2 +-
>  arch/x86/events/intel/ds.c                       |   6 +-
>  arch/x86/kvm/vmx/vmx.c                           |   2 +-
>  arch/x86/virt/hw.c                               |   2 +-
>  drivers/misc/sgi-xp/xpc_uv.c                     |   2 +-
>  drivers/net/ethernet/fungible/funeth/funeth_rx.c |   2 +-
>  include/linux/gfp.h                              |  28 +--
>  lib/Makefile                                     |   1 -
>  mm/Makefile                                      |   1 +
>  {lib => mm}/alloc_tag.c                          |  18 +-
>  mm/compaction.c                                  |   4 +-
>  mm/hugetlb.c                                     |   3 +-
>  mm/internal.h                                    |  20 +-
>  mm/mempolicy.c                                   |  10 +-
>  mm/page_alloc.c                                  | 254 +++++++++++++----------
>  mm/page_frag_cache.c                             |   4 +-
>  mm/slub.c                                        |   6 +-
>  19 files changed, 193 insertions(+), 176 deletions(-)
> ---
> base-commit: cbe5256a15fc26f592efb037e528da54b2139ee5
> change-id: 20260617-alloc-trylock-14ad37dab337
> 
> Best regards,
> --  
> Brendan Jackman <jackmanb@google.com>
> 


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 05/13] perf/x86/intel: Use higher-level allocator
  2026-06-22 10:01 ` [PATCH v2 05/13] perf/x86/intel: Use higher-level allocator Brendan Jackman
@ 2026-06-22 10:10   ` sashiko-bot
  2026-06-22 10:19     ` Brendan Jackman
  0 siblings, 1 reply; 34+ messages in thread
From: sashiko-bot @ 2026-06-22 10:10 UTC (permalink / raw)
  To: Brendan Jackman; +Cc: linux-rt-devel, linux-kernel

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The commit message factually misrepresents the API differences between `__alloc_pages_node()` and `alloc_pages_node()`.
--

commit a5667683e56825d97c5814c0349e4de3300e3e14
Author: Brendan Jackman <jackmanb@google.com>

perf/x86/intel: Use higher-level allocator

This commit switches the memory allocation in dsalloc_pages() from
__alloc_pages_node() to the higher-level alloc_pages_node() function.
It also updates a comment to reflect the API change.

> The difference between __alloc_pages_node() and alloc_pages_node() is
> that the former allows you to pass NUMA_NO_NODE.

[Severity: Medium]
Is this description of the API differences accurate?

Looking at include/linux/gfp.h, it appears the capabilities are actually
reversed. alloc_pages_node() is the function that explicitly supports
and safely handles NUMA_NO_NODE:

include/linux/gfp.h:alloc_pages_node_noprof() {
    if (nid == NUMA_NO_NODE)
        nid = numa_mem_id();
    ...
}

Meanwhile, __alloc_pages_node() expects a valid node ID and contains a
VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES) check, which will crash if
passed NUMA_NO_NODE.

Could the commit message be updated to clarify that alloc_pages_node()
is the API that safely handles NUMA_NO_NODE?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260622-alloc-trylock-v2-0-31f31367d420@google.com?part=5

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 06/13] KVM: VMX: Use higher-level allocator
  2026-06-22 10:01 ` [PATCH v2 06/13] KVM: VMX: " Brendan Jackman
@ 2026-06-22 10:10   ` sashiko-bot
  2026-06-22 10:21     ` Brendan Jackman
  0 siblings, 1 reply; 34+ messages in thread
From: sashiko-bot @ 2026-06-22 10:10 UTC (permalink / raw)
  To: Brendan Jackman; +Cc: linux-kernel, linux-rt-devel, kvm

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The commit message incorrectly states that `__alloc_pages_node()` allows passing `NUMA_NO_NODE`, while the opposite is true.
--

commit 7bd439c242125db27305b61b14c9972fb028282a
Author: Brendan Jackman <jackmanb@google.com>

KVM: VMX: Use higher-level allocator

This commit switches the allocation function used in alloc_vmcs_cpu()
from __alloc_pages_node() to alloc_pages_node().

> KVM: VMX: Use higher-level allocator
>
> The difference between __alloc_pages_node() and alloc_pages_node() is
> that the former allows you to pass NUMA_NO_NODE.

[Severity: Medium]
Is this description inverted?

Looking at include/linux/gfp.h, it appears __alloc_pages_node() explicitly
forbids NUMA_NO_NODE (-1) via VM_BUG_ON(nid < 0).

Instead, it is alloc_pages_node() that handles NUMA_NO_NODE by explicitly
checking for it and falling back to numa_mem_id().

While the code change itself is safe, the justification reverses the
behavior of the two APIs. Could the commit message be updated to
accurately reflect the API semantics?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260622-alloc-trylock-v2-0-31f31367d420@google.com?part=6

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 09/13] net/funeth: Switch to higher-level allocator
  2026-06-22 10:01 ` [PATCH v2 09/13] net/funeth: Switch to " Brendan Jackman
@ 2026-06-22 10:11   ` sashiko-bot
  2026-06-22 10:22     ` Brendan Jackman
  0 siblings, 1 reply; 34+ messages in thread
From: sashiko-bot @ 2026-06-22 10:11 UTC (permalink / raw)
  To: Brendan Jackman; +Cc: linux-kernel, linux-rt-devel

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The commit message logic regarding __alloc_pages_node and alloc_pages_node is inverted.
--

commit ab883602f87dc726f65726ac01fce73a498907b3
Author: Brendan Jackman <jackmanb@google.com>

net/funeth: Switch to higher-level allocator

This commit replaces __alloc_pages_node() with alloc_pages_node() in the
funeth driver.

> The difference between __alloc_pages_node() and alloc_pages_node() is
> that the former allows you to pass NUMA_NO_NODE.
> 
> The former is going away and the latter works fine here so switch over.

[Severity: Medium]
Is this description inverted? Looking at include/linux/gfp.h, it is
alloc_pages_node() that safely handles passing NUMA_NO_NODE by checking
if (nid == NUMA_NO_NODE). On the other hand, __alloc_pages_node() contains a
VM_BUG_ON() which strictly prevents passing NUMA_NO_NODE (-1).

The code change itself appears correct since the node variable can be -1 here,
but could the commit message be updated to accurately reflect which function
handles NUMA_NO_NODE?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260622-alloc-trylock-v2-0-31f31367d420@google.com?part=9

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 07/13] x86/virt: Use higher-level allocator
  2026-06-22 10:01 ` [PATCH v2 07/13] x86/virt: " Brendan Jackman
@ 2026-06-22 10:12   ` sashiko-bot
  2026-06-22 10:22     ` Brendan Jackman
  0 siblings, 1 reply; 34+ messages in thread
From: sashiko-bot @ 2026-06-22 10:12 UTC (permalink / raw)
  To: Brendan Jackman; +Cc: linux-rt-devel, linux-kernel

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Commit message factually misstates the difference between __alloc_pages_node() and alloc_pages_node()
--

commit ec153a4ff69fcf9b29806faedae74ed9c08f7dda
Author: Brendan Jackman <jackmanb@google.com>

x86/virt: Use higher-level allocator

This commit switches the __x86_vmx_init() function to use the higher-level
alloc_pages_node() function instead of __alloc_pages_node(). The code change
itself is safe and functions correctly.

> The difference between __alloc_pages_node() and alloc_pages_node() is
> that the former allows you to pass NUMA_NO_NODE.

[Severity: Low]
Is this description accurate?

Looking at the definitions, __alloc_pages_node() explicitly contains a
VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES), which forbids passing
NUMA_NO_NODE (-1).

Instead, alloc_pages_node() is the one that explicitly handles NUMA_NO_NODE
by converting it to numa_mem_id().

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260622-alloc-trylock-v2-0-31f31367d420@google.com?part=7

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 08/13] sgi-xp: Use higher-level allocator
  2026-06-22 10:01 ` [PATCH v2 08/13] sgi-xp: " Brendan Jackman
@ 2026-06-22 10:15   ` sashiko-bot
  2026-06-22 10:20   ` Greg Kroah-Hartman
  1 sibling, 0 replies; 34+ messages in thread
From: sashiko-bot @ 2026-06-22 10:15 UTC (permalink / raw)
  To: Brendan Jackman; +Cc: linux-kernel, linux-rt-devel

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:

New issues:
- [Medium] Commit message fundamentally misunderstands and inverts the documented differences between __alloc_pages_node() and alloc_pages_node().

Pre-existing issues:
- [High] Logic Error / Variable Mismatch in xpc_init_mq_node() breaks CPU fallback and NUMA affinity.
- [High] Hardware IRQ enabled before GRU message queue descriptors are fully initialized leads to NULL pointer dereference on spurious interrupts.
--

commit 2717112c630ddd5adcf0324575c2741c6d3bf969
Author: Brendan Jackman <jackmanb@google.com>

sgi-xp: Use higher-level allocator

This commit switches xpc_create_gru_mq_uv() to use alloc_pages_node() instead
of __alloc_pages_node(). The change is intended to replace an allocator
function that is being removed with one that handles similar requirements.

> sgi-xp: Use higher-level allocator
> 
> The difference between __alloc_pages_node() and alloc_pages_node() is
> that the former allows you to pass NUMA_NO_NODE.
> 
> The former is going away and the latter works fine here so switch over.

[Severity: Medium]
Is this description accurate?

__alloc_pages_node() strictly prohibits NUMA_NO_NODE, while
alloc_pages_node() safely handles it by falling back to numa_mem_id().

While the code change itself appears safe here since cpu_to_node() returns
a valid node, could the commit message be updated to reflect the correct
behavior of these memory allocation APIs?

> diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c
> index 772c787268932..aacff70204241 100644
> --- a/drivers/misc/sgi-xp/xpc_uv.c
> +++ b/drivers/misc/sgi-xp/xpc_uv.c
> @@ -170,7 +170,7 @@ xpc_create_gru_mq_uv(unsigned int mq_size, int cpu, char *irq_name,
>  	mq->mmr_blade = uv_cpu_to_blade_id(cpu);
>  
>  	nid = cpu_to_node(cpu);
> -	page = __alloc_pages_node(nid,
> +	page = alloc_pages_node(nid,
>  				      GFP_KERNEL | __GFP_ZERO | __GFP_THISNODE,
>  				      pg_order);

[Severity: High]
This isn't a bug introduced by this patch, but looking at the interrupt setup
that occurs further down in xpc_create_gru_mq_uv():

drivers/misc/sgi-xp/xpc_uv.c:xpc_create_gru_mq_uv() {
    ...
    ret = request_irq(mq->irq, irq_handler, 0, irq_name, NULL);
    ...
}

If a spurious interrupt occurs immediately after request_irq() is called,
could xpc_handle_activate_IRQ_uv() dereference the global xpc_activate_mq_uv
pointer before it is initialized?

drivers/misc/sgi-xp/xpc_uv.c:xpc_handle_activate_IRQ_uv() {
    ...
    msg_hdr = gru_get_next_message(xpc_activate_mq_uv->gru_mq_desc);
    ...
}

The global pointer doesn't seem to be assigned until xpc_create_gru_mq_uv()
returns to its caller.

[Severity: High]
This is a pre-existing issue, but looking at xpc_init_mq_node() which calls
xpc_create_gru_mq_uv():

drivers/misc/sgi-xp/xpc_uv.c:xpc_init_mq_node() {
    ...
    for_each_cpu(cpu, cpumask_of_node(nid)) {
        xpc_activate_mq_uv =
            xpc_create_gru_mq_uv(XPC_ACTIVATE_MQ_SIZE_UV, nid,
    ...
}

Does this loop inadvertently pass the nid variable instead of the cpu variable
to xpc_create_gru_mq_uv()?

This appears to bypass the CPU fallback iteration and could result in
querying uv_cpu_to_blade_id() and cpu_to_node() with a node index rather
than a CPU index.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260622-alloc-trylock-v2-0-31f31367d420@google.com?part=8

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 10/13] mm: Remove __alloc_pages_node()
  2026-06-22 10:01 ` [PATCH v2 10/13] mm: Remove __alloc_pages_node() Brendan Jackman
@ 2026-06-22 10:17   ` sashiko-bot
  2026-06-22 10:28     ` Brendan Jackman
  0 siblings, 1 reply; 34+ messages in thread
From: sashiko-bot @ 2026-06-22 10:17 UTC (permalink / raw)
  To: Brendan Jackman; +Cc: linux-rt-devel, linux-kernel

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] The patch leaves `__folio_alloc_node()` exposed to the exact same CPU hotplug out-of-bounds vulnerability that justified the removal of `__alloc_pages_node()`.
--

commit b690a6726aee701f88a87b35d2db8bfbfa39bc05
Author: Brendan Jackman <jackmanb@google.com>

mm: Remove __alloc_pages_node()

This patch removes __alloc_pages_node() because its usage with cpu_to_node()
can return NUMA_NO_NODE during CPU hotplug, bypassing validation and causing
out-of-bounds accesses on NODE_DATA().

> diff --git a/include/linux/gfp.h b/include/linux/gfp.h
> index cdf95a9f0b87c..7edcc2e0be9ce 100644
> --- a/include/linux/gfp.h
> +++ b/include/linux/gfp.h
> @@ -278,21 +278,6 @@ static inline void warn_if_node_offline(int this_node, gfp_t gfp_mask)
>  	dump_stack();
>  }
>  
> -/*
> - * Allocate pages, preferring the node given as nid. The node must be valid and
> - * online. For more general interface, see alloc_pages_node().
> - */
> -static inline struct page *
> -__alloc_pages_node_noprof(int nid, gfp_t gfp_mask, unsigned int order)
> -{
> -	VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES);
> -	warn_if_node_offline(nid, gfp_mask);
> -
> -	return __alloc_pages_noprof(gfp_mask, order, nid, NULL);
> -}
> -
> -#define  __alloc_pages_node(...)		alloc_hooks(__alloc_pages_node_noprof(__VA_ARGS__))
> -
>  static inline
>  struct folio *__folio_alloc_node_noprof(gfp_t gfp, unsigned int order, int nid)
>  {

[Severity: High]
This isn't a bug introduced by this patch, but does leaving
__folio_alloc_node_noprof() exposed maintain the exact same CPU hotplug
vulnerability that justified removing __alloc_pages_node()?

The commit message notes that passing the result of cpu_to_node() to the
allocator can yield NUMA_NO_NODE if the CPU is hotplugged out, which
bypasses validation and causes out-of-bounds accesses on NODE_DATA().

Can this still happen with __folio_alloc_node()? For example, in
net/sunrpc/svc.c, svc_prepare_thread() calls:

rqstp->rq_scratch_folio = __folio_alloc_node(GFP_KERNEL, 0, node);

with a potentially invalid node ID originating from cpu_to_node(). Should
__folio_alloc_node() also be removed or updated to safely handle
NUMA_NO_NODE?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260622-alloc-trylock-v2-0-31f31367d420@google.com?part=10

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 05/13] perf/x86/intel: Use higher-level allocator
  2026-06-22 10:10   ` sashiko-bot
@ 2026-06-22 10:19     ` Brendan Jackman
  0 siblings, 0 replies; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 10:19 UTC (permalink / raw)
  To: sashiko-reviews, Brendan Jackman; +Cc: linux-rt-devel, linux-kernel

On Mon Jun 22, 2026 at 10:10 AM UTC, sashiko-bot wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] The commit message factually misrepresents the API differences between `__alloc_pages_node()` and `alloc_pages_node()`.
> --
>
> commit a5667683e56825d97c5814c0349e4de3300e3e14
> Author: Brendan Jackman <jackmanb@google.com>
>
> perf/x86/intel: Use higher-level allocator
>
> This commit switches the memory allocation in dsalloc_pages() from
> __alloc_pages_node() to the higher-level alloc_pages_node() function.
> It also updates a comment to reflect the API change.
>
>> The difference between __alloc_pages_node() and alloc_pages_node() is
>> that the former allows you to pass NUMA_NO_NODE.
            ^^^^^^
    Sashiko is correct, that should say "latter".
>
> [Severity: Medium]

Seems like an inflated severity rating, this is basically a typo in the
commit mesage, and anyone that noticed it would probably have realised
what happened.

> Is this description of the API differences accurate?
>
> Looking at include/linux/gfp.h, it appears the capabilities are actually
> reversed. alloc_pages_node() is the function that explicitly supports
> and safely handles NUMA_NO_NODE:
>
> include/linux/gfp.h:alloc_pages_node_noprof() {
>     if (nid == NUMA_NO_NODE)
>         nid = numa_mem_id();
>     ...
> }
>
> Meanwhile, __alloc_pages_node() expects a valid node ID and contains a
> VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES) check, which will crash if
> passed NUMA_NO_NODE.
>
> Could the commit message be updated to clarify that alloc_pages_node()
> is the API that safely handles NUMA_NO_NODE?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 08/13] sgi-xp: Use higher-level allocator
  2026-06-22 10:01 ` [PATCH v2 08/13] sgi-xp: " Brendan Jackman
  2026-06-22 10:15   ` sashiko-bot
@ 2026-06-22 10:20   ` Greg Kroah-Hartman
  1 sibling, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2026-06-22 10:20 UTC (permalink / raw)
  To: Brendan Jackman
  Cc: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan, Muchun Song, Oscar Salvador,
	David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Mike Rapoport, Matthew Brost, Joshua Hahn, Rakie Kim,
	Byungchul Park, Ying Huang, Alistair Popple, Hao Li,
	Christoph Lameter, David Rientjes, Roman Gushchin,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt,
	Harry Yoo (Oracle), Gregory Price, Alexei Starovoitov,
	Matthew Wilcox, linux-mm, linux-kernel, linux-rt-devel,
	Robin Holt, Steve Wahl, Arnd Bergmann

On Mon, Jun 22, 2026 at 10:01:35AM +0000, Brendan Jackman wrote:
> The difference between __alloc_pages_node() and alloc_pages_node() is
> that the former allows you to pass NUMA_NO_NODE.
> 
> The former is going away and the latter works fine here so switch over.
> 
> Cc: Robin Holt <robinmholt@gmail.com>
> Cc: Steve Wahl <steve.wahl@hpe.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Assisted-by: Gemini:unknown-model
> Signed-off-by: Brendan Jackman <jackmanb@google.com>
> ---
>  drivers/misc/sgi-xp/xpc_uv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c
> index 772c787268932..aacff70204241 100644
> --- a/drivers/misc/sgi-xp/xpc_uv.c
> +++ b/drivers/misc/sgi-xp/xpc_uv.c
> @@ -170,7 +170,7 @@ xpc_create_gru_mq_uv(unsigned int mq_size, int cpu, char *irq_name,
>  	mq->mmr_blade = uv_cpu_to_blade_id(cpu);
>  
>  	nid = cpu_to_node(cpu);
> -	page = __alloc_pages_node(nid,
> +	page = alloc_pages_node(nid,
>  				      GFP_KERNEL | __GFP_ZERO | __GFP_THISNODE,
>  				      pg_order);
>  	if (page == NULL) {
> 
> -- 
> 2.54.0
> 

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 12/13] mm: Move __alloc_pages() to mm/internal.h
  2026-06-22 10:01 ` [PATCH v2 12/13] mm: Move __alloc_pages() to mm/internal.h Brendan Jackman
@ 2026-06-22 10:21   ` sashiko-bot
  2026-06-22 11:14     ` Brendan Jackman
  2026-06-22 12:24   ` David Hildenbrand (Arm)
  1 sibling, 1 reply; 34+ messages in thread
From: sashiko-bot @ 2026-06-22 10:21 UTC (permalink / raw)
  To: Brendan Jackman; +Cc: linux-kernel, linux-rt-devel

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Missing EXPORT_SYMBOL for out-of-line alloc_pages_node_noprof() causes widespread module linker errors.
--

commit 42f7742177beb0066c00a7aa081250feb5859171
Author: Brendan Jackman <jackmanb@google.com>

mm: Move __alloc_pages() to mm/internal.h

This commit moves the __alloc_pages() family of internal functions to
mm/internal.h to restrict them to the mm subsystem. It also moves
alloc_pages_node_noprof() out-of-line into mm/page_alloc.c since it
depends on __alloc_pages_noprof().

> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 36f0d625a4390..38238203ef7b0 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c

[ ... ]

> @@ -5419,6 +5419,17 @@ struct page *__alloc_pages_noprof(gfp_t gfp, unsigned int order,
>  }
>  EXPORT_SYMBOL(__alloc_pages_noprof);

[Severity: Low]
Since __alloc_pages_noprof() is no longer visible outside of mm/, should this
EXPORT_SYMBOL be removed?

> +struct page *alloc_pages_node_noprof(int nid, gfp_t gfp_mask, unsigned int order)
> +{
> +	if (nid == NUMA_NO_NODE)
> +		nid = numa_mem_id();
> +
> +	VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES);
> +	warn_if_node_offline(nid, gfp_mask);
> +
> +	return __alloc_pages_noprof(gfp_mask, order, nid, NULL);
> +}

[Severity: Low]
Does this code cause module linker errors? alloc_pages_node_noprof() is called
by the alloc_pages_node() macro in include/linux/gfp.h, but it does not have
an EXPORT_SYMBOL.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260622-alloc-trylock-v2-0-31f31367d420@google.com?part=12

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 06/13] KVM: VMX: Use higher-level allocator
  2026-06-22 10:10   ` sashiko-bot
@ 2026-06-22 10:21     ` Brendan Jackman
  0 siblings, 0 replies; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 10:21 UTC (permalink / raw)
  To: sashiko-reviews, Brendan Jackman; +Cc: linux-kernel, linux-rt-devel, kvm

On Mon Jun 22, 2026 at 10:10 AM UTC, sashiko-bot wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] The commit message incorrectly states that `__alloc_pages_node()` allows passing `NUMA_NO_NODE`, while the opposite is true.
> --
>
> commit 7bd439c242125db27305b61b14c9972fb028282a
> Author: Brendan Jackman <jackmanb@google.com>
>
> KVM: VMX: Use higher-level allocator
>
> This commit switches the allocation function used in alloc_vmcs_cpu()
> from __alloc_pages_node() to alloc_pages_node().
>
>> KVM: VMX: Use higher-level allocator
>>
>> The difference between __alloc_pages_node() and alloc_pages_node() is
>> that the former allows you to pass NUMA_NO_NODE.
>
> [Severity: Medium]
> Is this description inverted?
>
> Looking at include/linux/gfp.h, it appears __alloc_pages_node() explicitly
> forbids NUMA_NO_NODE (-1) via VM_BUG_ON(nid < 0).
>
> Instead, it is alloc_pages_node() that handles NUMA_NO_NODE by explicitly
> checking for it and falling back to numa_mem_id().
>
> While the code change itself is safe, the justification reverses the
> behavior of the two APIs. Could the commit message be updated to
> accurately reflect the API semantics?

Repeating myself[0] as this patch has a different CC list from the others:

Sashiko is correct, the commit message says "former" but it should say
"latter".

[0] https://lore.kernel.org/all/DJFI39RWHV1O.MMMMMZSK8E8C@linux.dev/

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 07/13] x86/virt: Use higher-level allocator
  2026-06-22 10:12   ` sashiko-bot
@ 2026-06-22 10:22     ` Brendan Jackman
  0 siblings, 0 replies; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 10:22 UTC (permalink / raw)
  To: sashiko-reviews, Brendan Jackman; +Cc: linux-rt-devel, linux-kernel

On Mon Jun 22, 2026 at 10:12 AM UTC, sashiko-bot wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Low] Commit message factually misstates the difference between __alloc_pages_node() and alloc_pages_node()
> --
>
> commit ec153a4ff69fcf9b29806faedae74ed9c08f7dda
> Author: Brendan Jackman <jackmanb@google.com>
>
> x86/virt: Use higher-level allocator
>
> This commit switches the __x86_vmx_init() function to use the higher-level
> alloc_pages_node() function instead of __alloc_pages_node(). The code change
> itself is safe and functions correctly.
>
>> The difference between __alloc_pages_node() and alloc_pages_node() is
>> that the former allows you to pass NUMA_NO_NODE.
>
> [Severity: Low]
> Is this description accurate?
>
> Looking at the definitions, __alloc_pages_node() explicitly contains a
> VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES), which forbids passing
> NUMA_NO_NODE (-1).
>
> Instead, alloc_pages_node() is the one that explicitly handles NUMA_NO_NODE
> by converting it to numa_mem_id().

Repeating myself[0] as this patch has a different CC list from the others:

Sashiko is correct, the commit message says "former" but it should say
"latter".

[0] https://lore.kernel.org/all/DJFI39RWHV1O.MMMMMZSK8E8C@linux.dev/

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 09/13] net/funeth: Switch to higher-level allocator
  2026-06-22 10:11   ` sashiko-bot
@ 2026-06-22 10:22     ` Brendan Jackman
  0 siblings, 0 replies; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 10:22 UTC (permalink / raw)
  To: sashiko-reviews, Brendan Jackman; +Cc: linux-kernel, linux-rt-devel

On Mon Jun 22, 2026 at 10:11 AM UTC, sashiko-bot wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] The commit message logic regarding __alloc_pages_node and alloc_pages_node is inverted.
> --
>
> commit ab883602f87dc726f65726ac01fce73a498907b3
> Author: Brendan Jackman <jackmanb@google.com>
>
> net/funeth: Switch to higher-level allocator
>
> This commit replaces __alloc_pages_node() with alloc_pages_node() in the
> funeth driver.
>
>> The difference between __alloc_pages_node() and alloc_pages_node() is
>> that the former allows you to pass NUMA_NO_NODE.
>> 
>> The former is going away and the latter works fine here so switch over.
>
> [Severity: Medium]
> Is this description inverted? Looking at include/linux/gfp.h, it is
> alloc_pages_node() that safely handles passing NUMA_NO_NODE by checking
> if (nid == NUMA_NO_NODE). On the other hand, __alloc_pages_node() contains a
> VM_BUG_ON() which strictly prevents passing NUMA_NO_NODE (-1).
>
> The code change itself appears correct since the node variable can be -1 here,
> but could the commit message be updated to accurately reflect which function
> handles NUMA_NO_NODE?


Repeating myself[0] as this patch has a different CC list from the others:

Sashiko is correct, the commit message says "former" but it should say
"latter".

[0] https://lore.kernel.org/all/DJFI39RWHV1O.MMMMMZSK8E8C@linux.dev/

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 10/13] mm: Remove __alloc_pages_node()
  2026-06-22 10:17   ` sashiko-bot
@ 2026-06-22 10:28     ` Brendan Jackman
  0 siblings, 0 replies; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 10:28 UTC (permalink / raw)
  To: sashiko-reviews, Brendan Jackman; +Cc: linux-rt-devel, linux-kernel

On Mon Jun 22, 2026 at 10:17 AM UTC, sashiko-bot wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
>
> Pre-existing issues:
> - [High] The patch leaves `__folio_alloc_node()` exposed to the exact same CPU hotplug out-of-bounds vulnerability that justified the removal of `__alloc_pages_node()`.
> --
>
> commit b690a6726aee701f88a87b35d2db8bfbfa39bc05
> Author: Brendan Jackman <jackmanb@google.com>
>
> mm: Remove __alloc_pages_node()
>
> This patch removes __alloc_pages_node() because its usage with cpu_to_node()
> can return NUMA_NO_NODE during CPU hotplug, bypassing validation and causing
> out-of-bounds accesses on NODE_DATA().
>
>> diff --git a/include/linux/gfp.h b/include/linux/gfp.h
>> index cdf95a9f0b87c..7edcc2e0be9ce 100644
>> --- a/include/linux/gfp.h
>> +++ b/include/linux/gfp.h
>> @@ -278,21 +278,6 @@ static inline void warn_if_node_offline(int this_node, gfp_t gfp_mask)
>>  	dump_stack();
>>  }
>>  
>> -/*
>> - * Allocate pages, preferring the node given as nid. The node must be valid and
>> - * online. For more general interface, see alloc_pages_node().
>> - */
>> -static inline struct page *
>> -__alloc_pages_node_noprof(int nid, gfp_t gfp_mask, unsigned int order)
>> -{
>> -	VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES);
>> -	warn_if_node_offline(nid, gfp_mask);
>> -
>> -	return __alloc_pages_noprof(gfp_mask, order, nid, NULL);
>> -}
>> -
>> -#define  __alloc_pages_node(...)		alloc_hooks(__alloc_pages_node_noprof(__VA_ARGS__))
>> -
>>  static inline
>>  struct folio *__folio_alloc_node_noprof(gfp_t gfp, unsigned int order, int nid)
>>  {
>
> [Severity: High]
> This isn't a bug introduced by this patch, but does leaving
> __folio_alloc_node_noprof() exposed maintain the exact same CPU hotplug
> vulnerability that justified removing __alloc_pages_node()?
  ^^^^^^^^^^^^^ No, Sashiko-chan! Why are you disclosing this critical
	        vulnerability without an embargo!?!?!
>
> The commit message notes that passing the result of cpu_to_node() to the
> allocator can yield NUMA_NO_NODE if the CPU is hotplugged out, which
> bypasses validation and causes out-of-bounds accesses on NODE_DATA().
>
> Can this still happen with __folio_alloc_node()? For example, in
> net/sunrpc/svc.c, svc_prepare_thread() calls:
>
> rqstp->rq_scratch_folio = __folio_alloc_node(GFP_KERNEL, 0, node);
>
> with a potentially invalid node ID originating from cpu_to_node(). Should
> __folio_alloc_node() also be removed or updated to safely handle
> NUMA_NO_NODE?

Serious answer: this is discussed in the cover letter, leaving the
*folio* API untouched was deliberate.

(Not saying we _shouldn't_ make that change, but this patchset is
already pretty big and the __alloc_pages* changes had an ulterior
motive).

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 12/13] mm: Move __alloc_pages() to mm/internal.h
  2026-06-22 10:21   ` sashiko-bot
@ 2026-06-22 11:14     ` Brendan Jackman
  0 siblings, 0 replies; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 11:14 UTC (permalink / raw)
  To: sashiko-reviews, Brendan Jackman; +Cc: linux-kernel, linux-rt-devel

On Mon Jun 22, 2026 at 10:21 AM UTC, sashiko-bot wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Low] Missing EXPORT_SYMBOL for out-of-line alloc_pages_node_noprof() causes widespread module linker errors.
> --
>
> commit 42f7742177beb0066c00a7aa081250feb5859171
> Author: Brendan Jackman <jackmanb@google.com>
>
> mm: Move __alloc_pages() to mm/internal.h
>
> This commit moves the __alloc_pages() family of internal functions to
> mm/internal.h to restrict them to the mm subsystem. It also moves
> alloc_pages_node_noprof() out-of-line into mm/page_alloc.c since it
> depends on __alloc_pages_noprof().
>
>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> index 36f0d625a4390..38238203ef7b0 100644
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>
> [ ... ]
>
>> @@ -5419,6 +5419,17 @@ struct page *__alloc_pages_noprof(gfp_t gfp, unsigned int order,
>>  }
>>  EXPORT_SYMBOL(__alloc_pages_noprof);
>
> [Severity: Low]
> Since __alloc_pages_noprof() is no longer visible outside of mm/, should this
> EXPORT_SYMBOL be removed?

Yep.

>> +struct page *alloc_pages_node_noprof(int nid, gfp_t gfp_mask, unsigned int order)
>> +{
>> +	if (nid == NUMA_NO_NODE)
>> +		nid = numa_mem_id();
>> +
>> +	VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES);
>> +	warn_if_node_offline(nid, gfp_mask);
>> +
>> +	return __alloc_pages_noprof(gfp_mask, order, nid, NULL);
>> +}
>
> [Severity: Low]
> Does this code cause module linker errors? alloc_pages_node_noprof() is called
> by the alloc_pages_node() macro in include/linux/gfp.h, but it does not have
> an EXPORT_SYMBOL.

Yep. Doesn't show up in defconfig but if you set CONFIG_BLK_DEV_UBLK=m
then:

ERROR: modpost: "alloc_pages_node_noprof" [drivers/block/ublk_drv.ko] undefined!

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 12/13] mm: Move __alloc_pages() to mm/internal.h
  2026-06-22 10:01 ` [PATCH v2 12/13] mm: Move __alloc_pages() to mm/internal.h Brendan Jackman
  2026-06-22 10:21   ` sashiko-bot
@ 2026-06-22 12:24   ` David Hildenbrand (Arm)
  2026-06-22 13:05     ` Lorenzo Stoakes
  2026-06-22 13:07     ` Brendan Jackman
  1 sibling, 2 replies; 34+ messages in thread
From: David Hildenbrand (Arm) @ 2026-06-22 12:24 UTC (permalink / raw)
  To: Brendan Jackman, Andrew Morton, Vlastimil Babka,
	Suren Baghdasaryan, Michal Hocko, Johannes Weiner, Zi Yan,
	Muchun Song, Oscar Salvador, Lorenzo Stoakes, Liam R. Howlett,
	Mike Rapoport, Matthew Brost, Joshua Hahn, Rakie Kim,
	Byungchul Park, Ying Huang, Alistair Popple, Hao Li,
	Christoph Lameter, David Rientjes, Roman Gushchin,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt
  Cc: Harry Yoo (Oracle), Gregory Price, Alexei Starovoitov,
	Matthew Wilcox, linux-mm, linux-kernel, linux-rt-devel

On 6/22/26 12:01, Brendan Jackman wrote:
> It's no longer used outside of mm/.
> 
> Since this means __alloc_pages_noprof() is no longer visible from gfp.h,
> this also means moving the definition of alloc_pages_node_noprof into
> the .c file.
> 
> Signed-off-by: Brendan Jackman <jackmanb@google.com>
> ---
>  Documentation/admin-guide/cgroup-v1/cpusets.rst |  2 +-
>  Documentation/admin-guide/mm/transhuge.rst      |  2 +-
>  include/linux/gfp.h                             | 16 +---------------
>  mm/internal.h                                   |  4 ++++
>  mm/page_alloc.c                                 | 11 +++++++++++
>  5 files changed, 18 insertions(+), 17 deletions(-)

Do we want some mm/page_alloc.h , to start splitting up mm/internal.h

-- 
Cheers,

David

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 12/13] mm: Move __alloc_pages() to mm/internal.h
  2026-06-22 12:24   ` David Hildenbrand (Arm)
@ 2026-06-22 13:05     ` Lorenzo Stoakes
  2026-06-22 13:07     ` Brendan Jackman
  1 sibling, 0 replies; 34+ messages in thread
From: Lorenzo Stoakes @ 2026-06-22 13:05 UTC (permalink / raw)
  To: David Hildenbrand (Arm)
  Cc: Brendan Jackman, Andrew Morton, Vlastimil Babka,
	Suren Baghdasaryan, Michal Hocko, Johannes Weiner, Zi Yan,
	Muchun Song, Oscar Salvador, Liam R. Howlett, Mike Rapoport,
	Matthew Brost, Joshua Hahn, Rakie Kim, Byungchul Park, Ying Huang,
	Alistair Popple, Hao Li, Christoph Lameter, David Rientjes,
	Roman Gushchin, Sebastian Andrzej Siewior, Clark Williams,
	Steven Rostedt, Harry Yoo (Oracle), Gregory Price,
	Alexei Starovoitov, Matthew Wilcox, linux-mm, linux-kernel,
	linux-rt-devel

On Mon, Jun 22, 2026 at 02:24:36PM +0200, David Hildenbrand (Arm) wrote:
> On 6/22/26 12:01, Brendan Jackman wrote:
> > It's no longer used outside of mm/.
> >
> > Since this means __alloc_pages_noprof() is no longer visible from gfp.h,
> > this also means moving the definition of alloc_pages_node_noprof into
> > the .c file.
> >
> > Signed-off-by: Brendan Jackman <jackmanb@google.com>
> > ---
> >  Documentation/admin-guide/cgroup-v1/cpusets.rst |  2 +-
> >  Documentation/admin-guide/mm/transhuge.rst      |  2 +-
> >  include/linux/gfp.h                             | 16 +---------------
> >  mm/internal.h                                   |  4 ++++
> >  mm/page_alloc.c                                 | 11 +++++++++++
> >  5 files changed, 18 insertions(+), 17 deletions(-)
>
> Do we want some mm/page_alloc.h , to start splitting up mm/internal.h

Yes please!

>
> --
> Cheers,
>
> David

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 12/13] mm: Move __alloc_pages() to mm/internal.h
  2026-06-22 12:24   ` David Hildenbrand (Arm)
  2026-06-22 13:05     ` Lorenzo Stoakes
@ 2026-06-22 13:07     ` Brendan Jackman
  1 sibling, 0 replies; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 13:07 UTC (permalink / raw)
  To: David Hildenbrand (Arm), Brendan Jackman, Andrew Morton,
	Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan, Muchun Song, Oscar Salvador,
	Lorenzo Stoakes, Liam R. Howlett, Mike Rapoport, Matthew Brost,
	Joshua Hahn, Rakie Kim, Byungchul Park, Ying Huang,
	Alistair Popple, Hao Li, Christoph Lameter, David Rientjes,
	Roman Gushchin, Sebastian Andrzej Siewior, Clark Williams,
	Steven Rostedt
  Cc: Harry Yoo (Oracle), Gregory Price, Alexei Starovoitov,
	Matthew Wilcox, linux-mm, linux-kernel, linux-rt-devel

On Mon Jun 22, 2026 at 12:24 PM UTC, David Hildenbrand (Arm) wrote:
> On 6/22/26 12:01, Brendan Jackman wrote:
>> It's no longer used outside of mm/.
>> 
>> Since this means __alloc_pages_noprof() is no longer visible from gfp.h,
>> this also means moving the definition of alloc_pages_node_noprof into
>> the .c file.
>> 
>> Signed-off-by: Brendan Jackman <jackmanb@google.com>
>> ---
>>  Documentation/admin-guide/cgroup-v1/cpusets.rst |  2 +-
>>  Documentation/admin-guide/mm/transhuge.rst      |  2 +-
>>  include/linux/gfp.h                             | 16 +---------------
>>  mm/internal.h                                   |  4 ++++
>>  mm/page_alloc.c                                 | 11 +++++++++++
>>  5 files changed, 18 insertions(+), 17 deletions(-)
>
> Do we want some mm/page_alloc.h , to start splitting up mm/internal.h

Don't see why not, if people are on board I'm happy to do that for v3.

(I just realised I put __alloc_pages_noprof() at the bottom of the file,
while it should be next to __alloc_frozen_pages etc, should fix that in
case we don't end up going for the separated header).

So what would go in the new header...

- All the buddy alloc/free entry points
- ALLOC_ flags
- alloc_context
- buddy_order*(), page_is_buddy(), find_buddy_page_pfn() and
  __find_buddy_pfn()
- post_alloc_hook(), free_pages_prepare()
- zone_pcp_*()
- find_suitable_fallback()
- free_area_empty()

Anything else? Or anything on that list that should stay in
mm/internal.h?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 00/13] mm: Some cleanups for page allocator APIs
  2026-06-22 10:01 [PATCH v2 00/13] mm: Some cleanups for page allocator APIs Brendan Jackman
                   ` (13 preceding siblings ...)
  2026-06-22 10:05 ` [PATCH v2 00/13] mm: Some cleanups for page allocator APIs Vlastimil Babka (SUSE)
@ 2026-06-22 13:08 ` Lorenzo Stoakes
  2026-06-22 13:15   ` Brendan Jackman
  14 siblings, 1 reply; 34+ messages in thread
From: Lorenzo Stoakes @ 2026-06-22 13:08 UTC (permalink / raw)
  To: Brendan Jackman
  Cc: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan, Muchun Song, Oscar Salvador,
	David Hildenbrand, Liam R. Howlett, Mike Rapoport, Matthew Brost,
	Joshua Hahn, Rakie Kim, Byungchul Park, Ying Huang,
	Alistair Popple, Hao Li, Christoph Lameter, David Rientjes,
	Roman Gushchin, Sebastian Andrzej Siewior, Clark Williams,
	Steven Rostedt, Harry Yoo (Oracle), Gregory Price,
	Alexei Starovoitov, Matthew Wilcox, linux-mm, linux-kernel,
	linux-rt-devel, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	James Clark, Sean Christopherson, Paolo Bonzini, kvm,
	Thomas Gleixner, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Robin Holt, Steve Wahl, Arnd Bergmann,
	Greg Kroah-Hartman, Dimitris Michailidis, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni

Thanks for the series (cleanups are always welcome :) but just a gentle,
annoying, note to say it's week 2 of the merge window soooo we're not taking
anything at the moment as it's a quiet period (mm-unstable taking only fixes
AFAICT).

Though, it's potentially good to get stuff in front of people early, just an FYI
that we're trying to move towards keeping the merge window preview/RFC-only
going forwards.

I'm not sure if that'll fix the impossible review load problem (TM), but it at
least helps keep us sane re: what's actually landing/not.

So Andrew will expect you to resend this after 7.2-rc1 appears!

Thanks, Lorenzo

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 00/13] mm: Some cleanups for page allocator APIs
  2026-06-22 13:08 ` Lorenzo Stoakes
@ 2026-06-22 13:15   ` Brendan Jackman
  0 siblings, 0 replies; 34+ messages in thread
From: Brendan Jackman @ 2026-06-22 13:15 UTC (permalink / raw)
  To: Lorenzo Stoakes
  Cc: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan, Muchun Song, Oscar Salvador,
	David Hildenbrand, Liam R. Howlett, Mike Rapoport, Matthew Brost,
	Joshua Hahn, Rakie Kim, Byungchul Park, Ying Huang,
	Alistair Popple, Hao Li, Christoph Lameter, David Rientjes,
	Roman Gushchin, Sebastian Andrzej Siewior, Clark Williams,
	Steven Rostedt, Harry Yoo (Oracle), Gregory Price,
	Alexei Starovoitov, Matthew Wilcox, linux-mm, linux-kernel,
	linux-rt-devel, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	James Clark, Sean Christopherson, Paolo Bonzini, kvm,
	Thomas Gleixner, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Robin Holt, Steve Wahl, Arnd Bergmann,
	Greg Kroah-Hartman, Dimitris Michailidis, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni

On Mon, 22 Jun 2026 at 15:09, Lorenzo Stoakes <ljs@kernel.org> wrote:
>
> Thanks for the series (cleanups are always welcome :) but just a gentle,
> annoying, note to say it's week 2 of the merge window soooo we're not taking
> anything at the moment as it's a quiet period (mm-unstable taking only fixes
> AFAICT).
>
> Though, it's potentially good to get stuff in front of people early, just an FYI
> that we're trying to move towards keeping the merge window preview/RFC-only
> going forwards.
>
> I'm not sure if that'll fix the impossible review load problem (TM), but it at
> least helps keep us sane re: what's actually landing/not.
>
> So Andrew will expect you to resend this after 7.2-rc1 appears!

Sorry as I discovered on [0] I am completely ignorant about merge
windows, etc. Even after that thread it never really occurred to me
that people might not want to receive patches at all when busy trying
to get the rc into shape!

Anyway in this case I'm assuming there will be at least a v3 so I'll
just wait before sending that.

[0]: https://lore.kernel.org/all/DJD12YR8S99G.1I43PSHB77TA2@linux.dev/

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2026-06-22 13:15 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-22 10:01 [PATCH v2 00/13] mm: Some cleanups for page allocator APIs Brendan Jackman
2026-06-22 10:01 ` [PATCH v2 01/13] mm/page_alloc: rename ALLOC_TRYLOCK -> ALLOC_NOLOCK Brendan Jackman
2026-06-22 10:01 ` [PATCH v2 02/13] mm/page_alloc: some renames to clarify alloc_flags scopes Brendan Jackman
2026-06-22 10:01 ` [PATCH v2 03/13] mm/page_alloc: unify __alloc_frozen_pages[_nolock]_noprof() Brendan Jackman
2026-06-22 10:01 ` [PATCH v2 04/13] mm/page_alloc: relax GFP WARN in nolock allocs Brendan Jackman
2026-06-22 10:01 ` [PATCH v2 05/13] perf/x86/intel: Use higher-level allocator Brendan Jackman
2026-06-22 10:10   ` sashiko-bot
2026-06-22 10:19     ` Brendan Jackman
2026-06-22 10:01 ` [PATCH v2 06/13] KVM: VMX: " Brendan Jackman
2026-06-22 10:10   ` sashiko-bot
2026-06-22 10:21     ` Brendan Jackman
2026-06-22 10:01 ` [PATCH v2 07/13] x86/virt: " Brendan Jackman
2026-06-22 10:12   ` sashiko-bot
2026-06-22 10:22     ` Brendan Jackman
2026-06-22 10:01 ` [PATCH v2 08/13] sgi-xp: " Brendan Jackman
2026-06-22 10:15   ` sashiko-bot
2026-06-22 10:20   ` Greg Kroah-Hartman
2026-06-22 10:01 ` [PATCH v2 09/13] net/funeth: Switch to " Brendan Jackman
2026-06-22 10:11   ` sashiko-bot
2026-06-22 10:22     ` Brendan Jackman
2026-06-22 10:01 ` [PATCH v2 10/13] mm: Remove __alloc_pages_node() Brendan Jackman
2026-06-22 10:17   ` sashiko-bot
2026-06-22 10:28     ` Brendan Jackman
2026-06-22 10:01 ` [PATCH v2 11/13] alloc_tag: Move to mm/ Brendan Jackman
2026-06-22 10:01 ` [PATCH v2 12/13] mm: Move __alloc_pages() to mm/internal.h Brendan Jackman
2026-06-22 10:21   ` sashiko-bot
2026-06-22 11:14     ` Brendan Jackman
2026-06-22 12:24   ` David Hildenbrand (Arm)
2026-06-22 13:05     ` Lorenzo Stoakes
2026-06-22 13:07     ` Brendan Jackman
2026-06-22 10:01 ` [PATCH v2 13/13] mm: remove __GFP_NO_CODETAG Brendan Jackman
2026-06-22 10:05 ` [PATCH v2 00/13] mm: Some cleanups for page allocator APIs Vlastimil Babka (SUSE)
2026-06-22 13:08 ` Lorenzo Stoakes
2026-06-22 13:15   ` Brendan Jackman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox