From: Jakub Kicinski <kuba@kernel.org>
To: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, Jesper Dangaard Brouer <hawk@kernel.org>,
Alexander Duyck <alexander.duyck@gmail.com>,
Yonglong Liu <liuyonglong@huawei.com>,
Yunsheng Lin <linyunsheng@huawei.com>
Subject: Re: [RFC net] net: make page pool stall netdev unregistration to avoid IOMMU crashes
Date: Thu, 8 Aug 2024 07:51:59 -0700 [thread overview]
Message-ID: <20240808075159.4a58cc7d@kernel.org> (raw)
In-Reply-To: <CAC_iWj+z_6QZCOWv9DKZ1-ScOREtjSTzOBPw5VQCaWacJy3toQ@mail.gmail.com>
On Thu, 8 Aug 2024 17:30:31 +0300 Ilias Apalodimas wrote:
> > we get_device() hoping that it will keep the IOMMU machinery active
> > (even if the device won't use the page we need to unmap it when it's
> > freed), but it sounds like IOMMU dies when driver is unbound. Even if
> > there are outstanding references to the device.
> >
> > I occasionally hit this problem reloading drivers during development,
> > TBH, too. And we have been told we "use the API wrong" so let's fix
> > it on our end?..
>
> It's been a while since I looked at the use cases, but I don't love
> the idea of stalling the netdev removal until sockets process all
> packets. There's a chance that the device will stay there forever.
True, my thinking is that there are 3 cases:
- good case, nothing gets stalled
- pages held, no IOMMU, we may make it worse, user doesn't care
- pages held, IOMMU enabled, it would have crashed
given that we get so few reports about the third one, I tend towards
thinking that the risk of stall is somewhat limited.
> I'll have to take a closer look but the first thing that comes to mind
> is to unmap the pages early, before page_pool_destroy() is called and
> perhaps add a flag that says "the pool is there only to process
> existing packets, but you can't DMA into it anymore".
Yeah, but we need to find them... Maybe Alex knows how many rotten veg
will be thrown our way if we try to scan all struct pages, IDK if that's
considered acceptable.
next prev parent reply other threads:[~2024-08-08 14:52 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
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 [this message]
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=20240808075159.4a58cc7d@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).