All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: no-reply@sashiko.virtuozzo.com
To: alexander.ivanov@virtuozzo.com, khorenko@virtuozzo.com,
	Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 v2 6/7] dm-qcow2: process fast path qios in per-cpu batches on a workqueue
Date: Tue, 10 Nov 2026 12:06:07 +0000	[thread overview]
Message-ID: <010701a1c559ecd8-16f511f5-15ab-403d-b157-5597138e9d26-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261110114629.416695-7-andrey.zhadchenko@virtuozzo.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] dm-qcow2: commit message omits sleeping steps run serially in fast-path worker
--

Commit 6cf4c03ea626fb7fe01c889ccd2361694ab98cf0
Author: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>

dm-qcow2: process fast path qios in per-cpu batches on a workqueue

This replaces the per-qio work item on the fast path with a per-CPU llist
and a single per-CPU work item. The worker drains one batch per run and
requeues itself if more qios arrived meanwhile.

> The fast path is now serial per submitting CPU: qios queued from one
> CPU are processed one by one by its work, while qios from different
> CPUs are still processed in parallel. This is fine, since a fast path
> qio is only mapped and submitted as direct AIO: O_DIRECT is enforced
> for every delta. The exception is a partial discard, which punches
> the hole synchronously in the worker, so the qios queued after it on
> that CPU wait.

[Severity: Low]
This isn't a bug in the code, but the commit message looks incomplete.
It says a fast path qio is "only mapped and submitted as direct AIO" and
names only a partial discard as an exception. Is that accurate?

qcow2_fast_work() runs the whole batch serially:

> +	node = llist_del_all(&fc->qios);
> +	node = llist_reverse_order(node);
> +	llist_for_each_entry_safe(qio, next, node, fast_link)
> +		do_qio_work(qio);

For QIO_STATE_START, do_qio_work() calls prepare_one_embedded_qio(). For
multi-bio requests this reaches create_bvec_from_rq(), which does:

    bvec = kvmalloc_array(nr_bvec, sizeof(struct bio_vec), GFP_NOIO);

The qio split path also allocates through qcow2_alloc_qio(), which calls
mempool_alloc(GFP_NOIO). Both can sleep under memory pressure, and while
they do, every qio queued behind on that CPU is delayed.

The direct AIO submission via qcow2_call_rw_iter() can also block on the
inode lock. The partial discard case reaches issue_discard(), which calls
qcow2_punch_hole() synchronously, and the commit message already mentions
this.

Could the commit message list these other sleeping steps, or state that
only the discard case is the notable one and explain why the others are
acceptable?

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

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

  reply	other threads:[~2026-11-10 12:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=010701a1c559ecd8-16f511f5-15ab-403d-b157-5597138e9d26-000000@eu-central-1.amazonses.com \
    --to=no-reply@sashiko.virtuozzo.com \
    --cc=alexander.ivanov@virtuozzo.com \
    --cc=andrey.zhadchenko@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=khorenko@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.