All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 0/2] dm-qcow2, dm-ploop: do not merge discards with gaps
Date: Tue, 10 Nov 2026 18:46:49 +0100	[thread overview]
Message-ID: <179433280956.3561434.9617315271236803444.b4-review@b4> (raw)
In-Reply-To: <20261109153619.277888-1-andrey.zhadchenko@virtuozzo.com>

Applying with these fixes on my side:
- 1/2: the example replaced with one that can happen on dm-qcow2,
  with units, plus what the user sees
- 2/2: the example replaced with one that loses data on dm-ploop,
  plus what the user sees
- both: "range in the file" -> "range of the device", "always"
  dropped, why the limit is USHRT_MAX, paragraphs

On Mon, 09 Nov 2026 18:36:17 +0300, Andrey Zhadchenko wrote:
> Both dm-qcow2 and dm-ploop handle a discard request as one contiguous
> range taken from blk_rq_pos() and blk_rq_bytes(). For a request built
> from bios [0, 512) and [1024, 1536) they discard [0, 1024), which hits
> sectors that were never asked to be discarded and misses part of the
> range that was.

Read in sectors, a 1024-sector discard request cannot be built on
dm-qcow2 with the default 64K cluster: max_hw_discard_sectors is one
cluster, and the merge is refused past it. On dm-ploop the example is
half a cluster, and ploop ignores discards that do not cover a whole
cluster, so nothing is lost there. The patch messages now carry an
example per target.

dm-tracking and dm-push-backup need the same limit, I filed a bug for
that:
https://virtuozzo.atlassian.net/browse/VSTOR-154423

Both take a discard request as one blk_rq_pos()/blk_rq_bytes() range,
and they inherit max_discard_segments from the origin. Over a patched
ploop or qcow2 that is 1, but over an origin with multi-range discard
(nvme, virtio-blk) they track the wrong clusters. Please send a
separate patch that gives both targets .io_hints with
max_discard_segments = 1.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team

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

  parent reply	other threads:[~2026-11-10 17:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 15:36 Andrey Zhadchenko
2026-11-09 15:36 ` [Devel] [PATCH hci-8.1 1/2] dm-qcow2: set max discard segments to one Andrey Zhadchenko
2026-11-09 15:44   ` no-reply
2026-11-10 17:46   ` Konstantin Khorenko
2026-11-09 15:36 ` [Devel] [PATCH hci-8.1 2/2] dm-ploop: " Andrey Zhadchenko
2026-11-09 15:44   ` no-reply
2026-11-10 17:46   ` Konstantin Khorenko
2026-11-10 10:03 ` [Devel] [PATCH hci-8.1 0/2] dm-qcow2, dm-ploop: do not merge discards with gaps Alexander Ivanov
2026-11-10 17:46 ` Konstantin Khorenko [this message]
2026-11-10 17:47 ` 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=179433280956.3561434.9617315271236803444.b4-review@b4 \
    --to=khorenko@virtuozzo.com \
    --cc=andrey.zhadchenko@virtuozzo.com \
    --cc=devel@openvz.org \
    /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.