All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: andrey.zhadchenko@virtuozzo.com, alexander.ivanov@virtuozzo.com,
	vasileios.almpanis@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.2 0/9] dm-qcow2: lockless fast path, direct completion, no I/O scheduler
Date: Wed, 25 Nov 2026 02:25:16 +0100	[thread overview]
Message-ID: <20261125012525.681662-1-den@openvz.org> (raw)

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

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

             reply	other threads:[~2026-11-25  1:26 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  1:25 Denis V. Lunev [this message]
2026-11-25  1:25 ` [Devel] [PATCH hci-8.2 1/9] dm-qcow2: move md_pages_lock off the deferred_lock cache line Denis V. Lunev
2026-12-01  0:05   ` no-reply
2026-11-25  1:25 ` [Devel] [PATCH hci-8.2 2/9] dm-qcow2: free md pages after an RCU grace period Denis V. Lunev
2026-11-25 11:19   ` Konstantin Khorenko
2026-12-01  0:06   ` no-reply
2026-11-25  1:25 ` [Devel] [PATCH hci-8.2 3/9] dm-qcow2: map fast path reads without md_pages_lock Denis V. Lunev
2026-11-25 11:19   ` Konstantin Khorenko
2026-12-01  0:17   ` no-reply
2026-11-25  1:25 ` [Devel] [PATCH hci-8.2 4/9] dm-qcow2: map fast path writes " Denis V. Lunev
2026-11-25 11:19   ` Konstantin Khorenko
2026-12-01  0:25   ` no-reply
2026-11-25  1:25 ` [Devel] [PATCH hci-8.2 5/9] dm-qcow2: submit fast path qios without deferred_lock Denis V. Lunev
2026-12-01  0:27   ` no-reply
2026-11-25  1:25 ` [Devel] [PATCH hci-8.2 6/9] dm-rq: complete dm-qcow2 requests directly in task context Denis V. Lunev
2026-11-25 11:19   ` Konstantin Khorenko
2026-12-01  0:35   ` no-reply
2026-11-25  1:25 ` [Devel] [PATCH hci-8.2 7/9] dm-qcow2: requeue requests when the request pool is empty Denis V. Lunev
2026-12-01  0:37   ` no-reply
2026-11-25  1:25 ` [Devel] [PATCH hci-8.2 8/9] dm-ploop: " Denis V. Lunev
2026-11-25 11:19   ` Konstantin Khorenko
2026-12-01  0:38   ` no-reply
2026-11-25  1:25 ` [Devel] [PATCH hci-8.2 9/9] dm: default dm-qcow2 devices to no I/O scheduler Denis V. Lunev
2026-11-25 11:19   ` Konstantin Khorenko
2026-12-01  0:39   ` no-reply
2026-11-25 11:19 ` [Devel] [PATCH hci-8.2 0/9] dm-qcow2: lockless fast path, direct completion, " Konstantin Khorenko
2026-11-26 13:58 ` Andrey Zhadchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261125012525.681662-1-den@openvz.org \
    --to=den@openvz.org \
    --cc=alexander.ivanov@virtuozzo.com \
    --cc=andrey.zhadchenko@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=vasileios.almpanis@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.