Re: [PATCH 00/11] md: avoid counter operation conflicts
From: Song Liu
Date: Wed Apr 10 2024 - 17:14:12 EST
Thanks for the patchset!
On Tue, Mar 26, 2024 at 3:29 AM tada keisuke <keisuke1.tada@xxxxxxxxxx> wrote:
>
> Currently, active_aligned_reads and nr_pending used as counters are atomic types.
> Therefore, when inc/dec in a multi-core results in conflicts.
>
> To solve this problem, use "percpu_ref" counters that can avoid conflicts and maintain consistency.
>
> Switch modes of percpu_ref to achieve both consistency and conflict avoidance.
> During normal operations such as inc/dec, it operates as percpu mode.
> When consistency is required, it operates as atomic mode.
> The operations that require consistency are as follows:
> ・Zero check for the counter
> ・All operations in RAID 1/10
IIUC, the patchset is to resolve race conditions and thus improve performance.
If this is the case, could you please include some performance numbers in the
next version?
Thanks,
Song