From: Jason Xing <kerneljasonxing@gmail.com>
To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, hawk@kernel.org, ilias.apalodimas@linaro.org,
horms@kernel.org
Cc: netdev@vger.kernel.org, Jason Xing <kerneljasonxing@gmail.com>
Subject: [PATCH net-next v1] page_pool: avoid infinite loop to schedule delayed worker
Date: Mon, 10 Feb 2025 21:09:53 +0800 [thread overview]
Message-ID: <20250210130953.26831-1-kerneljasonxing@gmail.com> (raw)
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
next reply other threads:[~2025-02-10 13:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-10 13:09 Jason Xing [this message]
2025-02-12 2:37 ` [PATCH net-next v1] page_pool: avoid infinite loop to schedule delayed worker 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250210130953.26831-1-kerneljasonxing@gmail.com \
--to=kerneljasonxing@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=horms@kernel.org \
--cc=ilias.apalodimas@linaro.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).