From: Jakub Kicinski <kuba@kernel.org>
To: Yonglong Liu <liuyonglong@huawei.com>
Cc: Yunsheng Lin <linyunsheng@huawei.com>, <netdev@vger.kernel.org>,
<davem@davemloft.net>, <edumazet@google.com>, <pabeni@redhat.com>,
<ilias.apalodimas@linaro.org>,
Jesper Dangaard Brouer <hawk@kernel.org>,
Alexander Duyck <alexander.duyck@gmail.com>
Subject: Re: [RFC net] net: make page pool stall netdev unregistration to avoid IOMMU crashes
Date: Thu, 8 Aug 2024 07:05:11 -0700 [thread overview]
Message-ID: <20240808070511.0befbdde@kernel.org> (raw)
In-Reply-To: <977c3d82-e2f0-4466-9100-7ea781e91ce1@huawei.com>
On Thu, 8 Aug 2024 20:52:52 +0800 Yonglong Liu wrote:
> I hooks the netdev to the page pool, and run with this patch for a
> while, then get
>
> the following messages, and the vf can not disable:
> [ 1950.137586] hns3 0000:7d:01.0 eno1v0: link up
> [ 1950.137671] hns3 0000:7d:01.0 eno1v0: net open
> [ 1950.147098] 8021q: adding VLAN 0 to HW filter on device eno1v0
> [ 1974.287476] hns3 0000:7d:01.0 eno1v0: net stop
> [ 1974.294359] hns3 0000:7d:01.0 eno1v0: link down
> [ 1975.596916] hns3 0000:7d:01.0 eno1v0 (unregistered): page pool
> release stalling device unregister
> [ 1976.744947] hns3 0000:7d:01.0 eno1v0 (unregistered): page pool
> release stalling device unregister
So.. the patch works? :) We may want to add this to get the info prints
back:
diff --git a/net/core/page_pool.c b/net/core/page_pool.c
index 2abe6e919224..26bc1618de7c 100644
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -1021,11 +1021,12 @@ static void page_pool_release_retry(struct work_struct *wq)
/* Periodic warning for page pools the user can't see */
netdev = READ_ONCE(pool->slow.netdev);
if (time_after_eq(jiffies, pool->defer_warn) &&
- (!netdev || netdev == NET_PTR_POISON)) {
+ (!netdev || netdev == NET_PTR_POISON || netdev->pp_unreg_pending)) {
int sec = (s32)((u32)jiffies - (u32)pool->defer_start) / HZ;
- pr_warn("%s() stalled pool shutdown: id %u, %d inflight %d sec\n",
- __func__, pool->user.id, inflight, sec);
+ pr_warn("%s(): %s stalled pool shutdown: id %u, %d inflight %d sec (hold netdev: %d)\n",
+ __func__, netdev ? netdev_name(netdev) : "",
+ pool->user.id, inflight, sec, pool->defer_warn);
pool->defer_warn = jiffies + DEFER_WARN_INTERVAL;
}
> I install drgn, but don't know how to find out the using pages, would
> you guide me on how to use it?
You can use this sample as a starting point:
https://github.com/osandov/drgn/blob/main/contrib/tcp_sock.py
but if the pages are actually leaked (rather than sitting in a socket),
you'll have to scan pages, not sockets. And figure out how they got leaked.
Somehow...
next prev parent reply other threads:[~2024-08-08 14:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-06 15:16 [RFC net] net: make page pool stall netdev unregistration to avoid IOMMU crashes Jakub Kicinski
2024-08-07 7:03 ` Yonglong Liu
2024-08-07 14:27 ` Jakub Kicinski
2024-08-08 1:11 ` Yonglong Liu
2024-08-07 11:00 ` Yunsheng Lin
2024-08-07 14:29 ` Jakub Kicinski
2024-08-08 12:52 ` Yonglong Liu
2024-08-08 14:05 ` Jakub Kicinski [this message]
2024-08-09 6:06 ` Yonglong Liu
2024-08-10 3:57 ` Jakub Kicinski
2024-08-14 10:09 ` Yonglong Liu
2024-08-14 14:56 ` Jakub Kicinski
2024-08-08 11:12 ` Ilias Apalodimas
2024-08-08 13:52 ` Jakub Kicinski
2024-08-08 14:30 ` Ilias Apalodimas
2024-08-08 14:51 ` Jakub Kicinski
2024-09-05 10:47 ` Yunsheng Lin
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=20240808070511.0befbdde@kernel.org \
--to=kuba@kernel.org \
--cc=alexander.duyck@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=ilias.apalodimas@linaro.org \
--cc=linyunsheng@huawei.com \
--cc=liuyonglong@huawei.com \
--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).