netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v1] page_pool: avoid infinite loop to schedule delayed worker
@ 2025-02-10 13:09 Jason Xing
  2025-02-12  2:37 ` Mina Almasry
  0 siblings, 1 reply; 15+ messages in thread
From: Jason Xing @ 2025-02-10 13:09 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, hawk, ilias.apalodimas, horms
  Cc: netdev, Jason Xing

If the buggy driver causes the inflight less than 0 [1] and warns
us in page_pool_inflight(), it means we should not expect the
whole page_pool to get back to work normally.

We noticed the kworker is waken up repeatedly and infinitely[1]
in production. If the page pool detect the error happening,
probably letting it go is a better way and do not flood the
var log messages. This patch mitigates the adverse effect.

[1]
[Mon Feb 10 20:36:11 2025] ------------[ cut here ]------------
[Mon Feb 10 20:36:11 2025] Negative(-51446) inflight packet-pages
...
[Mon Feb 10 20:36:11 2025] Call Trace:
[Mon Feb 10 20:36:11 2025]  page_pool_release_retry+0x23/0x70
[Mon Feb 10 20:36:11 2025]  process_one_work+0x1b1/0x370
[Mon Feb 10 20:36:11 2025]  worker_thread+0x37/0x3a0
[Mon Feb 10 20:36:11 2025]  kthread+0x11a/0x140
[Mon Feb 10 20:36:11 2025]  ? process_one_work+0x370/0x370
[Mon Feb 10 20:36:11 2025]  ? __kthread_cancel_work+0x40/0x40
[Mon Feb 10 20:36:11 2025]  ret_from_fork+0x35/0x40
[Mon Feb 10 20:36:11 2025] ---[ end trace ebffe800f33e7e34 ]---

Signed-off-by: Jason Xing <kerneljasonxing@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 1c6fec08bc43..8e9f5801aabb 100644
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -1167,7 +1167,7 @@ void page_pool_destroy(struct page_pool *pool)
 	page_pool_disable_direct_recycling(pool);
 	page_pool_free_frag(pool);
 
-	if (!page_pool_release(pool))
+	if (page_pool_release(pool) <= 0)
 		return;
 
 	page_pool_detached(pool);
-- 
2.43.5


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

end of thread, other threads:[~2025-02-13  1:01 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-10 13:09 [PATCH net-next v1] page_pool: avoid infinite loop to schedule delayed worker Jason Xing
2025-02-12  2:37 ` Mina Almasry
2025-02-12  2:46   ` Jakub Kicinski
2025-02-12  3:20     ` Jason Xing
2025-02-12  3:43       ` Jakub Kicinski
2025-02-12  4:38         ` Jason Xing
2025-02-12 18:53           ` Jakub Kicinski
2025-02-12 23:37             ` Jason Xing
2025-02-12  3:14   ` Jason Xing
2025-02-12 19:24     ` Mina Almasry
2025-02-12 23:38       ` Jason Xing
2025-02-13  0:38         ` Mina Almasry
2025-02-13  0:43           ` Jason Xing
2025-02-13  0:51             ` Mina Almasry
2025-02-13  1:01               ` Jason Xing

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