OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: no-reply@sashiko.virtuozzo.com
To: alexander.ivanov@virtuozzo.com,
	Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>,
	ptikhomirov@virtuozzo.com
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 5/7] drivers/md/dm-qcow2: implement per-qio fast processing
Date: Thu, 29 Oct 2026 14:22:03 +0000	[thread overview]
Message-ID: <010701a1880a1014-e1c2a3f6-aadc-422a-afbc-87d1e22a5c9e-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261029140346.465768-6-andrey.zhadchenko@virtuozzo.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] dm-qcow2: qio_try_fast() uses list_add() and reverses the order of deferred sibling splits
--

commit 3954eb13b0c2923af1fc503136a833ede7213254
Author: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>

drivers/md/dm-qcow2: implement per-qio fast processing

This commit makes do_qio_work() split a qio and then try to process each
piece right away with process_one_qio(..., true). Pieces that still need
metadata work are put on a local list and spliced onto
qcow2->qios[QLIST_DEFERRED] for do_qcow2_work().

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

> diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
> --- a/drivers/md/dm-qcow2-map.c
> +++ b/drivers/md/dm-qcow2-map.c

[ ... ]

> +static void qio_try_fast(struct qio *qio, struct list_head *deferred_qios)
> +{
> +	list_del(&qio->link);
> +
> +	if (process_one_qio(qio->qcow2, qio, true))
> +		list_add(&qio->link, deferred_qios);

[Severity: Low]
Can this list_add() reverse the order of the deferred pieces?

qcow2_split_qio_to_list() builds the split list in ascending order, with
the parent last:

    list_splice_tail(&list, ret_list);
    list_add_tail(&qio->link, ret_list);

do_qio_work() walks that list front to back and calls qio_try_fast() on
each entry. Since list_add() inserts at the head of deferred_qios, each
piece that returns 1 from process_one_qio() lands in front of the earlier
ones. deferred_qios therefore ends up in descending order.

That list is then spliced to qcow2->qios[QLIST_DEFERRED] with
list_splice_tail(), so the slow-path pieces of one request are queued in
reverse order. Before this patch, prepare_one_embedded_qio() filled the
deferred list directly, and the order was preserved.

I did not find a correctness problem. Each piece covers a different
cluster, and process_deferred_qios() does not depend on order. The visible
effect is that cluster and metadata allocation and submission happen in
reverse order for large writes that need allocation.

Would list_add_tail() be more appropriate here to keep the original order?

> +}
> +
>  static void do_qio_work(struct work_struct *ws)
>  {

[ ... ]

> +		prepare_one_embedded_qio(qio, &split_qios);
> +		list_for_each_entry_safe(i, next, &split_qios, link)
> +			qio_try_fast(i, &deferred_qios);

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

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

  reply	other threads:[~2026-10-29 14:23 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29 14:03 [Devel] [PATCH 0/7] drivers/md/dm-qcow2: per-qio fast path Andrey Zhadchenko
2026-10-29 14:03 ` [Devel] [PATCH hci-8.1 1/7] drivers/md/dm-qcow2: repeat md page lookup if it was inserted in parallel Andrey Zhadchenko
2026-10-29 14:13   ` no-reply
2026-11-04 21:35   ` Konstantin Khorenko
2026-10-29 14:03 ` [Devel] [PATCH hci-8.1 2/7] drivers/md/dm-qcow2: check MD_DIRTY and md->wbd under lock in perform_rw_mapped() Andrey Zhadchenko
2026-10-29 14:13   ` no-reply
2026-11-04 21:35   ` Konstantin Khorenko
2026-10-29 14:03 ` [Devel] [PATCH hci-8.1 3/7] drivers/md/dm-qcow2: prepare process_one_qio() for fastpath Andrey Zhadchenko
2026-10-29 14:16   ` no-reply
2026-11-02 17:28   ` Alexander Ivanov
2026-11-04 21:35   ` Konstantin Khorenko
2026-10-29 14:03 ` [Devel] [PATCH hci-8.1 4/7] drivers/md/dm-qcow2: add per-qio work infrastructure Andrey Zhadchenko
2026-10-29 14:18   ` no-reply
2026-11-04 21:35   ` Konstantin Khorenko
2026-10-29 14:03 ` [Devel] [PATCH hci-8.1 5/7] drivers/md/dm-qcow2: implement per-qio fast processing Andrey Zhadchenko
2026-10-29 14:22   ` no-reply [this message]
2026-11-04 21:35   ` Konstantin Khorenko
2026-10-29 14:03 ` [Devel] [PATCH hci-8.1 6/7] drivers/md/dm-qcow2: declare DM_TARGET_NOWAIT Andrey Zhadchenko
2026-10-29 14:19   ` no-reply
2026-11-03  8:33   ` Alexander Ivanov
2026-11-04 21:35   ` Konstantin Khorenko
2026-10-29 14:03 ` [Devel] [PATCH hci-8.1 7/7] drivers/md/dm-qcow2: process fast path qios in per-cpu batches on a workqueue Andrey Zhadchenko
2026-10-29 14:22   ` no-reply
2026-11-02 10:49     ` Andrey Zhadchenko
2026-11-04 21:35   ` Konstantin Khorenko
2026-11-03  9:36 ` [Devel] [PATCH 0/7] drivers/md/dm-qcow2: per-qio fast path Alexander Ivanov
2026-11-04 21:35 ` 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=010701a1880a1014-e1c2a3f6-aadc-422a-afbc-87d1e22a5c9e-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=ptikhomirov@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox