Commit 067c5c24cef2 for kernel

commit 067c5c24cef23d913b67eaaf71ae67e7169a6620
Merge: f7c68e9d5d05 2122887b04f3
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Tue Nov 10 08:58:21 2026 -0800

    Merge tag 'page_alloc-for-7.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/mm/page_alloc

    Pull page allocator fixes from Vlastimil Babka:

     - Stable fixes for various races of page allocator's reading of
       zonelists and memory hotplug activity. These can result in BUGs,
       allocation failures or allocations from wrong nodes (Gregory Price,
       Josef Bacik)

     - Stable fixes for bugs free_pages_nolock(), page_frag allocation, page
       isolation, that can trigger WARNs, degraded operation or infinite
       loop (Josef Bacik)

    * tag 'page_alloc-for-7.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/mm/page_alloc:
      mm/page_alloc: remove the zone_spans_pfn() check from get_pfnblock_bitmap_bitidx()
      mm/memory_hotplug: resize zones under their seqlock
      mm: page_isolation: do not take slab pages for free
      mm: page_frag: refill the cache for large fragments
      mm/page_alloc: clear ->private of deferred free pages
      mm/page_alloc: don't undo another isolation in alloc_contig_range
      mm/mmzone: remove zonelist_node_idx()
      mm/mempolicy: read the zoneref slot once in mempolicy_slab_node()
      mm/page_alloc: retry alloc_contig_pages() when the zonelist is rebuilt
      mm/hugetlb: retry the pool walk when the zonelist is rebuilt
      mm/page_alloc: retry allocations that raced with a zonelist rebuild
      mm/mmzone: read each zoneref slot once when filtering by nodemask
      mm/page_alloc: snapshot the preferred zone against shrink rebuilds
      mm/mmzone: read the zoneref slot once in zonelist_zone()
      mm/page_alloc: detect zonelist rebuilds from memory hot-add
      mm, page_alloc: pass zone pointer to trace_reclaim_retry_zone
      mm/page_alloc: keep the pagesets of an empty zone
      mm/page_alloc: reset can_retry_reserves when the slowpath restarts

diff --cc mm/page_alloc.c
index eb4f02617f53,e3a2f54f63e2..6624293e4d78
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@@ -4788,21 -4790,9 +4795,21 @@@ __alloc_pages_slowpath(gfp_t gfp_mask,
  	unsigned int zonelist_iter_cookie;
  	int reserve_flags;
  	bool compact_first = false;
- 	bool can_retry_reserves = true;
+ 	bool can_retry_reserves;
  	unsigned long alloc_start_time = jiffies;

 +	/*
 +	 * Costly __GFP_NORETRY callers have a cheap fallback, so don't stall
 +	 * them in reclaim or compaction. __GFP_THISNODE callers are exempt.
 +	 */
 +	if (costly_order && (gfp_mask & __GFP_NORETRY) &&
 +	    !(gfp_mask & __GFP_THISNODE))
 +		gfp_mask &= ~__GFP_DIRECT_RECLAIM;
 +
 +	can_direct_reclaim = gfp_mask & __GFP_DIRECT_RECLAIM;
 +	can_compact = can_direct_reclaim && gfp_compaction_allowed(gfp_mask);
 +	nofail = gfp_mask & __GFP_NOFAIL;
 +
  	if (unlikely(nofail)) {
  		/*
  		 * We don't support __GFP_NOFAIL without __GFP_DIRECT_RECLAIM,