All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: no-reply@sashiko.virtuozzo.com
To: "Denis V. Lunev" <den@openvz.org>,
	andrey.zhadchenko@virtuozzo.com, alexander.ivanov@virtuozzo.com,
	vasileios.almpanis@virtuozzo.com
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.2 7/9] dm-qcow2: requeue requests when the request pool is empty
Date: Tue, 1 Dec 2026 00:37:30 +0000	[thread overview]
Message-ID: <010701a22f09055a-db78bcee-d7d3-48d6-9cd2-f3333cc6e864-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261125012525.681662-8-den@openvz.org>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Low] dm-qcow2: bug-fix commit lacks a Fixes: trailer
- [Low] dm-qcow2: commit message and comment misdescribe QRQ pool sizing
--

commit a330f95d960153bb6811c7c36e6af96c4873e137
Author: Denis V. Lunev <den@openvz.org>

dm-qcow2: requeue requests when the request pool is empty

The commit makes qcow2_clone_and_map() return DM_MAPIO_REQUEUE instead of
DM_MAPIO_KILL when mempool_alloc(GFP_ATOMIC) fails. It also replaces the
comment on QCOW2_QRQ_POOL_SIZE.

> The request pool was sized at twice mq-deadline's default nr_requests
> of 2 * min(depth, BLKDEV_DEFAULT_RQ). With the default single hardware
> queue, even a request from every tag could not exhaust the reserve.
>
> Without a scheduler the device has dm_mq_queue_depth tags per hardware
> queue. If GFP_ATOMIC slab allocation fails with more requests in flight
> than the reserve can cover, qcow2_clone_and_map() kills the next request
> and the guest gets an I/O error. Return DM_MAPIO_REQUEUE so blk-mq
> applies backpressure and retries the request when resources free up.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-95494
> Feature: dm-qcow2: block device over QCOW2 files driver
> Signed-off-by: Denis V. Lunev <den@openvz.org>

[Severity: Low]
This fixes a spurious I/O error on allocation failure, so should it carry:

  Fixes: 2a728299abdb ("dm-qcow2: Introduce driver to create block devices over QCOW2 files")

> diff --git a/drivers/md/dm-qcow2.h b/drivers/md/dm-qcow2.h
> --- a/drivers/md/dm-qcow2.h
> +++ b/drivers/md/dm-qcow2.h
> @@ -193,7 +193,8 @@ struct qcow2_backward_merge {
>  
>  struct qcow2_target {
>  	struct dm_target *ti;
> -#define QCOW2_QRQ_POOL_SIZE 512 /* Twice nr_requests from blk_mq_init_sched() */
> +/* Reserve to keep requests moving when slab allocations fail. */
> +#define QCOW2_QRQ_POOL_SIZE 512
>  	mempool_t *qrq_pool;
>  	mempool_t *qio_pool;

[Severity: Low]
This isn't a functional problem, but are the first paragraph of the commit
message and this comment accurate about the pool sizing?

The pool was not "sized" this way by this patch, since QCOW2_QRQ_POOL_SIZE
stays at 512. The claim that the reserve cannot be exhausted holds only
with mq-deadline, where nr_requests is 2 * min(2048, 128) = 256. Without a
scheduler, DM_MQ_QUEUE_DEPTH is 2048 tags, which is more than 512. The
series makes no-scheduler the default (dm: default dm-qcow2 devices to no
I/O scheduler), so the first paragraph describes a configuration that no
longer applies. It also reads as if the pool can never run dry, which
contradicts the second paragraph.

The old comment explaining why 512 was chosen is removed, and the new one
gives no sizing rationale. Could the message and comment say that 512 is
not enough to cover all tags without a scheduler, and that the requeue
path handles that case?

Carry the trailer below into the next revision and Sashiko will not review this patch again.

Reviewed-by: Sashiko <no-reply@sashiko.virtuozzo.com>

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261125012525.681662-1-den@openvz.org?part=7

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

  reply	other threads:[~2026-12-01  0:38 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  1:25 [Devel] [PATCH hci-8.2 0/9] dm-qcow2: lockless fast path, direct completion, no I/O scheduler Denis V. Lunev
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 [this message]
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=010701a22f09055a-db78bcee-d7d3-48d6-9cd2-f3333cc6e864-000000@eu-central-1.amazonses.com \
    --to=no-reply@sashiko.virtuozzo.com \
    --cc=alexander.ivanov@virtuozzo.com \
    --cc=andrey.zhadchenko@virtuozzo.com \
    --cc=den@openvz.org \
    --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.