From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 2/2] dm-ploop: set max discard segments to one
Date: Tue, 10 Nov 2026 18:46:49 +0100 [thread overview]
Message-ID: <179433280956.3561434.18350690260771711057.b4-review@b4> (raw)
In-Reply-To: <20261109153619.277888-3-andrey.zhadchenko@virtuozzo.com>
Applying with these fixes on my side:
- the example: a whole 1M cluster [0, 2048) built from bios [0, 1024)
and [2048, 3072), instead of [0, 512) and [1024, 1536)
- "range in the file" -> "range of the device", "always" dropped
- added why the limit is USHRT_MAX and what the user sees, split into
paragraphs
On Mon, 09 Nov 2026 18:36:19 +0300, Andrey Zhadchenko wrote:
> Imagine we have a request with starting sector 0 and length 1024,
> so read or write means [0, 1024) range in the file. For discard this
> request can have 2 bios [0, 512) and [1024, 1536), but we always
> discarded [0, 1024).
ploop_handle_discard_pio() ignores a discard that is not a whole
cluster, so with the default 1M cluster this request discards nothing.
Data is lost only when a gapped request adds up to a whole cluster. The
message now reads:
Discard is a special type of request that can have non-contiguous
bios: dm-ploop keeps the dm stacking default max_discard_segments =
USHRT_MAX, so the block layer merges discard bios with gaps.
Imagine we have 1M clusters and a request with starting sector 0 and
length 2048 sectors, so read or write means the [0, 2048) range of
the device. For discard this request can have 2 bios [0, 1024) and
[2048, 3072), but we discarded the whole cluster [0, 2048).
Data in sectors 1024-2047 reads back as zeroes.
Set max_discard_segments to 1 to avoid such merges.
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev 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 [Devel] [PATCH hci-8.1 0/2] dm-qcow2, dm-ploop: do not merge discards with gaps 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 [this message]
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
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.18350690260771711057.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox