netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] page pool: not return page to alloc cache during pool destruction
@ 2023-06-15  1:36 Liang Chen
  2023-06-15  4:20 ` Jakub Kicinski
  2023-06-15  9:01 ` Yunsheng Lin
  0 siblings, 2 replies; 8+ messages in thread
From: Liang Chen @ 2023-06-15  1:36 UTC (permalink / raw)
  To: hawk, ilias.apalodimas
  Cc: netdev, linux-kernel, davem, edumazet, kuba, pabeni, Liang Chen

When destroying a page pool, the alloc cache and recycle ring are emptied.
If there are inflight pages, the retry process will periodically check the
recycle ring for recently returned pages, but not the alloc cache (alloc
cache is only emptied once). As a result, any pages returned to the alloc
cache after the page pool destruction will be stuck there and cause the
retry process to continuously look for inflight pages and report warnings.

To safeguard against this situation, any pages returning to the alloc cache
after pool destruction should be prevented.

Signed-off-by: Liang Chen <liangchen.linux@gmail.com>
---
 net/core/page_pool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/page_pool.c b/net/core/page_pool.c
index a3e12a61d456..76255313d349 100644
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -595,7 +595,7 @@ __page_pool_put_page(struct page_pool *pool, struct page *page,
 			page_pool_dma_sync_for_device(pool, page,
 						      dma_sync_size);
 
-		if (allow_direct && in_softirq() &&
+		if (allow_direct && in_softirq() && !pool->destroy_cnt &&
 		    page_pool_recycle_in_cache(page, pool))
 			return NULL;
 
-- 
2.31.1


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

end of thread, other threads:[~2023-06-16  3:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-15  1:36 [PATCH net-next] page pool: not return page to alloc cache during pool destruction Liang Chen
2023-06-15  4:20 ` Jakub Kicinski
2023-06-15 10:49   ` Ilias Apalodimas
2023-06-15 14:00   ` Jesper Dangaard Brouer
2023-06-16  2:45     ` Jakub Kicinski
2023-06-16  3:07     ` Liang Chen
2023-06-15  9:01 ` Yunsheng Lin
2023-06-15  9:06   ` Yunsheng Lin

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).