[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHS8izPQQwpHTwJqTL+6cvo04sC1WEhcY7WuA_Umquk4oRCGag@mail.gmail.com>
Date: Mon, 9 Dec 2024 09:08:06 -0800
From: Mina Almasry <almasrymina@...gle.com>
To: David Wei <dw@...idwei.uk>
Cc: io-uring@...r.kernel.org, netdev@...r.kernel.org,
Jens Axboe <axboe@...nel.dk>, Pavel Begunkov <asml.silence@...il.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jesper Dangaard Brouer <hawk@...nel.org>, David Ahern <dsahern@...nel.org>,
Stanislav Fomichev <stfomichev@...il.com>, Joe Damato <jdamato@...tly.com>,
Pedro Tammela <pctammela@...atatu.com>
Subject: Re: [PATCH net-next v8 05/17] net: page_pool: add ->scrub mem
provider callback
On Wed, Dec 4, 2024 at 9:22 AM David Wei <dw@...idwei.uk> wrote:
>
> From: Pavel Begunkov <asml.silence@...il.com>
>
> Some page pool memory providers like io_uring need to catch the point
> when the page pool is asked to be destroyed. ->destroy is not enough
> because it relies on the page pool to wait for its buffers first, but
> for that to happen a provider might need to react, e.g. to collect all
> buffers that are currently given to the user space.
>
> Add a new provider's scrub callback serving the purpose and called off
> the pp's generic (cold) scrubbing path, i.e. page_pool_scrub().
>
> Signed-off-by: Pavel Begunkov <asml.silence@...il.com>
> Signed-off-by: David Wei <dw@...idwei.uk>
I think after numerous previous discussions on this op, I guess I
finally see the point.
AFAIU on destruction tho io_uring instance will destroy the page_pool,
but we need to drop the user reference in the memory region. So the
io_uring instance will destroy the pool, then the scrub callback tells
io_uring that the pool is being destroyed, which drops the user
references.
I would have preferred if io_uring drops the user references before
destroying the pool, which I think would have accomplished the same
thing without adding a memory provider callback that is a bit specific
to this use case, but I guess it's all the same.
Reviewed-by: Mina Almasry <almasrymina@...gle.com>
--
Thanks,
Mina
Powered by blists - more mailing lists