[Devel] [PATCH hci-8.1 3/3] dm-qcow2: let discards of one L2 page wait for in-flight writes together

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Thu Nov 12 14:24:53 MSK 2026


> Only one discard at a time switches the generation of an L2 page and
> waits for the previous one to drain. Others queue behind it and then
> do the same one by one, so N discards of clusters mapped by one L2
> page take N drain cycles under write load. This is the common case:
> discards updating the same L2 page complete its writeback together
> and come to process_indexes_end() in one batch.
> 
> A discard, which finds a switch in progress while no write is counted
> in the new generation yet, has exactly the same writes to wait for as
> the discard which switched. Let it join: wait for the same previous
> generation instead of queueing for its own switch. If that generation
> is already empty, nothing is in flight and the discard goes on
> immediately.
> 
> Count the discards waiting for the previous generation instead of
> keeping a flag, and allow the next switch when the last of them is
> released.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-154659
> Feature: dm-qcow2: block device over QCOW2 files driver
> Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261112111205.736027-1-andrey.zhadchenko@virtuozzo.com?part=3




More information about the Devel mailing list