Thread (109 messages) 109 messages, 6 authors, 2024-04-02

Re: [PATCH v3 09/30] block: Pre-allocate zone write plugs

From: Christoph Hellwig <hch@lst.de>
Date: 2024-03-28 06:04:02
Also in: dm-devel, linux-nvme, linux-scsi

On Thu, Mar 28, 2024 at 03:02:54PM +0900, Damien Le Moal wrote:
But that is the problem: "checking the zone number again" means referencing the
plug struct again from the lookup context while the last ref drop context is
freeing the plug. That race can be lost by the lookup context and lead to
referencing freed memory. So your solution would be OK for pre-allocated plugs
only.
Not if it is done in the Rcu critical section.
For kmalloc-ed() plugs, we still need the rcu grace period for free. So we
can only optimize for the pre-allocated plugs...
Yes, bt it can use kfree_rcu which doesn't need the rcu_head in the
zwplug.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help