linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][RESEND][RFC] Fix 32-bit boot failure due inaccurate page_pool_page_is_pp()
@ 2025-09-12 23:06 Helge Deller
  2025-09-14 17:06 ` Christoph Biedl
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Helge Deller @ 2025-09-12 23:06 UTC (permalink / raw)
  To: David Hildenbrand, Toke Høiland-Jørgensen,
	Jesper Dangaard Brouer, Ilias Apalodimas, David S. Miller,
	Linux Memory Management List, netdev, Linux parisc List,
	Andrew Morton

Commit ee62ce7a1d90 ("page_pool: Track DMA-mapped pages and unmap them when
destroying the pool") changed PP_MAGIC_MASK from 0xFFFFFFFC to 0xc000007c on
32-bit platforms.

The function page_pool_page_is_pp() uses PP_MAGIC_MASK to identify page pool
pages, but the remaining bits are not sufficient to unambiguously identify
such pages any longer.

So page_pool_page_is_pp() now sometimes wrongly reports pages as page pool
pages and as such triggers a kernel BUG as it believes it found a page pool
leak.

There are patches upcoming where page_pool_page_is_pp() will not depend on
PP_MAGIC_MASK and instead use page flags to identify page pool pages. Until
those patches are merged, the easiest temporary fix is to disable the check
on 32-bit platforms.

Cc: Jesper Dangaard Brouer <hawk@kernel.org>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: David Hildenbrand <david@redhat.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Toke Høiland-Jørgensen <toke@redhat.com>
Cc: Linux Memory Management List <linux-mm@kvack.org>
Cc: netdev@vger.kernel.org
Cc: Linux parisc List <linux-parisc@vger.kernel.org>
Cc: <stable@vger.kernel.org> # v6.15+
Signed-off-by: Helge Deller <deller@gmx.de>
Link: https://www.spinics.net/lists/kernel/msg5849623.html
Fixes: ee62ce7a1d90 ("page_pool: Track DMA-mapped pages and unmap them when destroying the pool")

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 1ae97a0b8ec7..f3822ae70a81 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -4190,7 +4190,7 @@ int arch_lock_shadow_stack_status(struct task_struct *t, unsigned long status);
  */
 #define PP_MAGIC_MASK ~(PP_DMA_INDEX_MASK | 0x3UL)
 
-#ifdef CONFIG_PAGE_POOL
+#if defined(CONFIG_PAGE_POOL) && defined(CONFIG_64BIT)
 static inline bool page_pool_page_is_pp(const struct page *page)
 {
 	treturn (page->pp_magic & PP_MAGIC_MASK) == PP_SIGNATURE;

----- End forwarded message -----


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

end of thread, other threads:[~2025-09-22 15:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-12 23:06 [PATCH][RESEND][RFC] Fix 32-bit boot failure due inaccurate page_pool_page_is_pp() Helge Deller
2025-09-14 17:06 ` Christoph Biedl
2025-09-15  9:45 ` Jesper Dangaard Brouer
2025-09-15 11:44 ` Toke Høiland-Jørgensen
2025-09-15 13:08   ` Helge Deller
2025-09-15 20:41     ` Mina Almasry
2025-09-15 23:51     ` Mina Almasry
2025-09-16  9:27       ` Toke Høiland-Jørgensen
2025-09-16 22:21         ` Mina Almasry
2025-09-17  6:27           ` Helge Deller
2025-09-17 10:08           ` Toke Høiland-Jørgensen
2025-09-18  0:28             ` Mina Almasry
2025-09-22 15:49               ` Toke Høiland-Jørgensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).