[Devel] [PATCH hci-8.2 5/9] dm-qcow2: submit fast path qios without deferred_lock

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Tue Dec 1 03:27:34 MSK 2026


> From: Denis V. Lunev <den at openvz.org>
> 
> qcow2_submit_embedded_qio() takes deferred_lock for every request only
> to check pause_submitting_qios: an embedded qio is put on no list under
> the lock, it goes to the per-cpu fast path list. With metadata parsing
> off md_pages_lock, this is the next lock all submitting CPUs share.
> 
> Check the pause without the lock. A submitter holds an inflight_ref
> reference before it looks at the flag:
> - one that misses a pause holds a reference of the old index, which
>   set_backward_merge_in_process() waits for in
>   qcow2_inflight_ref_switch(). qcow2_ref_inc() takes it inside
>   rcu_read_lock(), so it either lands before the grace period of
>   percpu_ref_kill() ends and is waited for, or the tryget fails and
>   the submitter retries on the new index;
> - one that gets a reference of the new index must see the pause, so
>   order the flag before the index switch with smp_wmb(), paired with
>   the smp_rmb() in qcow2_ref_inc();
> - one that sees the pause cleared must see the new
>   backward_merge_in_process, so clear it with release semantics and
>   read it with acquire.
> A paused or flush qio still takes the lock and the old path.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-95494
> Feature: dm-qcow2: block device over QCOW2 files driver
> Signed-off-by: Denis V. Lunev <den at openvz.org>

Sashiko has reviewed this patch and found no issues.

Carry the trailer below into the next revision and Sashiko will not review this patch again.

Reviewed-by: Sashiko <no-reply at sashiko.virtuozzo.com>

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261125012525.681662-1-den@openvz.org?part=5




More information about the Devel mailing list