lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8a17ffe7-b2ce-4316-8243-512dd40522cc@gmail.com>
Date: Mon, 9 Dec 2024 17:24:52 +0000
From: Pavel Begunkov <asml.silence@...il.com>
To: Mina Almasry <almasrymina@...gle.com>, David Wei <dw@...idwei.uk>
Cc: io-uring@...r.kernel.org, netdev@...r.kernel.org,
 Jens Axboe <axboe@...nel.dk>, 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 12/9/24 17:08, Mina Almasry wrote:
> 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.

For unrelated reasons I moved it to a later stage to io_uring code,
so pool->mp_ops->scrub is no more. v8 is just weird, I think David
sent an old branch because Jakub asked or so.

> Reviewed-by: Mina Almasry <almasrymina@...gle.com>

-- 
Pavel Begunkov


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ