Thread (34 messages) 34 messages, 8 authors, 2024-10-15

Re: [PATCH net v2 2/2] page_pool: fix IOMMU crash when driver has already unbound

From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Date: 2024-10-02 08:23:59
Also in: bpf, imx, intel-wired-lan, linux-arm-kernel, linux-iommu, linux-mediatek, linux-mm, linux-rdma, linux-wireless, lkml

Hi Paolo,

On Wed, 2 Oct 2024 at 10:38, Paolo Abeni [off-list ref] wrote:
Hi,

On 10/2/24 04:34, Yunsheng Lin wrote:
quoted
On 10/1/2024 9:32 PM, Paolo Abeni wrote:
quoted
Is the problem only tied to VFs drivers? It's a pity all the page_pool
users will have to pay a bill for it...
I am afraid it is not only tied to VFs drivers, as:
attempting DMA unmaps after the driver has already unbound may leak
resources or at worst corrupt memory.

Unloading PFs driver might cause the above problems too, I guess the
probability of crashing is low for the PF as PF can not be disable
unless it can be hot-unplug'ed, but the probability of leaking resources
behind the dma mapping might be similar.
Out of sheer ignorance, why/how the refcount acquired by the page pool
on the device does not prevent unloading?

I fear the performance impact could be very high: AFICS, if the item
array become fragmented, insertion will take linar time, with the quite
large item_count/pool size. If so, it looks like a no-go.
It would be could if someone could test that. I'll look around in case
we have any test machines with cards that run on page pool.
I fear we should consider blocking the device removal until all the
pages are returned/unmapped ?!? (I hope that could be easier/faster)
Jakub send an RFC doing that [0]. Yes, this is far far simpler and
does not affect performance, but aren't we implicitly breaking
userspace?

[0] https://lore.kernel.org/netdev/20240806151618.1373008-1-kuba@kernel.org/ (local)

Thanks
/Ilias
/P
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help