[Devel] [PATCH hci-8.2 3/9] dm-qcow2: map fast path reads without md_pages_lock

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Tue Dec 1 03:17:26 MSK 2026


> From: Denis V. Lunev <den at openvz.org>
> 
> Every fast path read takes md_pages_lock in parse_metadata() to look
> up the L1 and L2 pages and read their entries. The lock is global for
> the device, so reads from all submitting CPUs serialize on it, and
> adding submitters makes each read more expensive instead of adding
> throughput.
> 
> Map the common read without the lock: both pages cached and clean, no
> index of them locked, and the cluster mapped exactly once, not
> compressed and not all-zeroes. Anything else falls back to the locked
> parse. The pages are found with rb_find_rcu(), which the RCU freeing
> of md pages makes safe. L1 and L2 pages stay cached once they are
> uptodate, so the pointers stay valid after rcu_read_unlock() as they
> do after the lock.
> [ ... ]
> reused cluster. That race is VSTOR-154939, accepted as Won't Fix.
> 
> 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=3




More information about the Devel mailing list