[Devel] [PATCH hci-8.2 0/9] dm-qcow2: lockless fast path, direct completion, no I/O scheduler
Denis V. Lunev
den at openvz.org
Wed Nov 25 04:25:16 MSK 2026
On top of Andrey's "dm-qcow2: per-qio fast path" v3 [1] the fast path still
serializes on md_pages_lock and deferred_lock, every request completes
through BLOCK_SOFTIRQ (usually in ksoftirqd), and the device runs under
mq-deadline. This series maps fast path reads and overwrites without
md_pages_lock (a per md page generation counter, md pages freed after an
RCU grace period), submits without deferred_lock, completes dm-qcow2
requests directly in the worker, and makes dm-qcow2 default to no I/O
scheduler. dm-qcow2 and dm-ploop now requeue a request instead of
failing it when the request pool is empty, since without mq-deadline
the queue is deeper than the pools were sized for.
The series applies on top of v3 [1] rebased to hci-8.2.
The scheduler default is the largest single step. mq-deadline caps a
device at 256 requests in flight (2 * min(depth, BLKDEV_DEFAULT_RQ)), so a
guest disk with several virtqueues is throttled to that regardless of its
queue sizes, and its dispatch lock serializes all submitters: v3 under
mq-deadline does fewer IOPS with 24 jobs than with 8. dm-qcow2 does not
reorder or merge anything the elevator could help with, the backing file's
own queue still has its scheduler, and IO limits (blk-throttle) act on bios
before the elevator. What is lost is I/O priority class arbitration on the
dm device; mq-deadline can still be selected through sysfs.
4K random I/O, iodepth 32 per job, brd-backed ext4, 1M clusters, fio jobs
one per core across all NUMA nodes, the same patches on the hci-8.1
kernel, kIOPS / p99 us:
v3 v3 this series
(mq-deadline) (none) (none, default)
read, 8 jobs 550 / 848 1554 / 578 1836 / 191
read, 24 jobs 384 / 2040 1690 / 1401 4308 / 214
write, 8 jobs 547 / 971 1353 / 627 1663 / 177
raw file on the same ext4: read 8 jobs 2162, 24 jobs 5377, write 8 jobs 1859
One job, same columns. QD1 as kIOPS / us per request (1 / IOPS) / p99 us,
QD32 as kIOPS / p99 us:
read, QD1 80 / 12.5 / 11 87 / 11.5 / 11 105 / 9.5 / 8
write, QD1 78 / 12.8 / 11 83 / 12.0 / 11 99 / 10.1 / 9
read, QD32 258 / 171 320 / 114 359 / 102
write, QD32 256 / 167 304 / 129 339 / 107
raw file: QD1 read 3.5 us, write 3.8 us per request
Tested on hci-8.2 (26.4) in a VM: ploop-pytest for the qcow2 and ploop
formats, data verification under concurrent read/write/discard. The
same checks passed on hci-8.1.
https://virtuozzo.atlassian.net/browse/VSTOR-95494
[1] http://lore.virtuozzo.com/kernel/20261113111126.793039-1-andrey.zhadchenko@virtuozzo.com/
Denis V. Lunev (9):
dm-qcow2: move md_pages_lock off the deferred_lock cache line
dm-qcow2: free md pages after an RCU grace period
dm-qcow2: map fast path reads without md_pages_lock
dm-qcow2: map fast path writes without md_pages_lock
dm-qcow2: submit fast path qios without deferred_lock
dm-rq: complete dm-qcow2 requests directly in task context
dm-qcow2: requeue requests when the request pool is empty
dm-ploop: requeue requests when the request pool is empty
dm: default dm-qcow2 devices to no I/O scheduler
drivers/md/dm-ploop-map.c | 2 +-
drivers/md/dm-ploop.h | 3 +-
drivers/md/dm-qcow2-cmd.c | 10 +-
drivers/md/dm-qcow2-map.c | 182 ++++++++++++++++++++++++++++------
drivers/md/dm-qcow2-target.c | 43 ++++++--
drivers/md/dm-qcow2.h | 33 +++++-
drivers/md/dm-rq.c | 22 ++++
drivers/md/dm-rq.h | 1 +
drivers/md/dm-zero-rq.c | 2 +-
include/linux/device-mapper.h | 5 +
10 files changed, 260 insertions(+), 43 deletions(-)
--
2.55.0
More information about the Devel
mailing list