All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
* [Devel] [PATCH hci-8.1 v2 0/7] dm-qcow2: per-qio fast path
@ 2026-11-10 11:46 Andrey Zhadchenko
  2026-11-10 11:46 ` [Devel] [PATCH hci-8.1 v2 1/7] dm-qcow2: repeat md page lookup if it was inserted in parallel Andrey Zhadchenko
                   ` (7 more replies)
  0 siblings, 8 replies; 26+ messages in thread
From: Andrey Zhadchenko @ 2026-11-10 11:46 UTC (permalink / raw)
  To: khorenko, alexander.ivanov; +Cc: devel

dm-qcow2 processes every request sequentially in a single kwork.
Unfortunately this introduces latency and cpu-bound limits. This
patchset adds a fast path: right after splitting, qios which need no
metadata changes are processed outside the main kwork, in parallel
with it and with each other. These are:
- reads and writes of fully allocated clusters;
- reads of unallocated clusters, which are zero-filled or forwarded
  to the lower delta;
- partial discards, which only punch a hole in the image file.
Everything else (allocations, COW, compressed clusters, discards
changing metadata, backward merge) still goes to the main kwork.

Fast path qios are batched in per-cpu llists and processed by one
work per submitting CPU, to avoid queue_work() cost on every I/O. The
target also declares DM_TARGET_NOWAIT now, so io_uring submits I/O
inline instead of punting every request to io-wq.

Patch 1 fixes a race with md page insertion which already exists
between qcow2_llseek_hole() and the main kwork, and which the fast
path makes more likely. Patch 2 makes perform_rw_mapped() safe to run
in parallel with the main kwork md writeback.

v2:
- patch 2 waits for L2 writeback, so a fast path write is not acked
  before its L2 entry is on disk
- batching goes before DM_TARGET_NOWAIT, and its worker no longer
  loops unbounded
- measurements moved to the thread
- subject prefix changed to dm-qcow2
Details are in the patches.

https://virtuozzo.atlassian.net/browse/VSTOR-95494

Andrey Zhadchenko (7):
  dm-qcow2: repeat md page lookup if it was inserted in parallel
  dm-qcow2: wait for L2 writeback in perform_rw_mapped()
  dm-qcow2: prepare process_one_qio() for fastpath
  dm-qcow2: add per-qio work infrastructure
  dm-qcow2: implement per-qio fast processing
  dm-qcow2: process fast path qios in per-cpu batches on a workqueue
  dm-qcow2: declare DM_TARGET_NOWAIT

 drivers/md/dm-qcow2-map.c    | 245 +++++++++++++++++++++++++++++------
 drivers/md/dm-qcow2-target.c |  12 +-
 drivers/md/dm-qcow2.h        |  16 ++-
 3 files changed, 229 insertions(+), 44 deletions(-)

-- 
2.43.5

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

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2026-11-11 15:36 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-10 11:46 [Devel] [PATCH hci-8.1 v2 0/7] dm-qcow2: per-qio fast path Andrey Zhadchenko
2026-11-10 11:46 ` [Devel] [PATCH hci-8.1 v2 1/7] dm-qcow2: repeat md page lookup if it was inserted in parallel Andrey Zhadchenko
2026-11-10 11:55   ` no-reply
2026-11-10 17:56   ` Konstantin Khorenko
2026-11-10 11:46 ` [Devel] [PATCH hci-8.1 v2 2/7] dm-qcow2: wait for L2 writeback in perform_rw_mapped() Andrey Zhadchenko
2026-11-10 11:56   ` no-reply
2026-11-10 17:56   ` Konstantin Khorenko
2026-11-10 11:46 ` [Devel] [PATCH hci-8.1 v2 3/7] dm-qcow2: prepare process_one_qio() for fastpath Andrey Zhadchenko
2026-11-10 11:59   ` no-reply
2026-11-10 13:50     ` Andrey Zhadchenko
2026-11-10 17:56   ` Konstantin Khorenko
2026-11-11 14:36   ` Alexander Ivanov
2026-11-10 11:46 ` [Devel] [PATCH hci-8.1 v2 4/7] dm-qcow2: add per-qio work infrastructure Andrey Zhadchenko
2026-11-10 12:02   ` no-reply
2026-11-11 15:34     ` Andrey Zhadchenko
2026-11-10 17:56   ` Konstantin Khorenko
2026-11-10 11:46 ` [Devel] [PATCH hci-8.1 v2 5/7] dm-qcow2: implement per-qio fast processing Andrey Zhadchenko
2026-11-10 12:08   ` no-reply
2026-11-10 17:56   ` Konstantin Khorenko
2026-11-10 11:46 ` [Devel] [PATCH hci-8.1 v2 6/7] dm-qcow2: process fast path qios in per-cpu batches on a workqueue Andrey Zhadchenko
2026-11-10 12:06   ` no-reply
2026-11-10 17:56   ` Konstantin Khorenko
2026-11-11 15:00   ` Alexander Ivanov
2026-11-10 11:46 ` [Devel] [PATCH hci-8.1 v2 7/7] dm-qcow2: declare DM_TARGET_NOWAIT Andrey Zhadchenko
2026-11-10 12:06   ` no-reply
2026-11-10 17:56 ` [Devel] [PATCH hci-8.1 v2 0/7] dm-qcow2: per-qio fast path Konstantin Khorenko

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.