[PATCH v3 08/30] block: Introduce zone write plugging

Bart Van Assche bvanassche at acm.org
Fri Mar 29 11:20:59 PDT 2024


On 3/28/24 3:38 PM, Damien Le Moal wrote:
> On 3/29/24 07:20, Bart Van Assche wrote:
>>> +	/* Wait for the zone write plugs to be RCU-freed. */
>>> +	rcu_barrier();
>>> +}
>>
>> It is not clear to me why the above rcu_barrier() call is necessary? I'm
>> not aware of any other kernel code where kfree_rcu() is followed by an
>> rcu_barrier() call.
> 
> Right after that, the mempool (in v4, free list here) is destroyed. So the
> rcu_barrier() is needed to ensure that the grace period is past and that all
> plugs are back in the pool/freelist. Without this, I saw problems/crashes when
> removing devices.

This patch would be easier to read if the rcu_barrier() call would be
moved out of disk_free_zone_wplugs() and into its caller.

Thanks,

Bart.




More information about the Linux-nvme mailing list