From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 v3 0/2] drivers/vhost/blk: support VIRTIO_BLK_F_WRITE_ZEROES
Date: Tue, 17 Nov 2026 14:50:46 +0100 [thread overview]
Message-ID: <179492344616.136195.11233301242407029938.b4-review@b4> (raw)
In-Reply-To: <20261117100904.3071306-1-alexander.ivanov@virtuozzo.com>
I won't apply this version, please send v4 with the changes below.
1. Patch 2: take the shape Andrey asked for in his reply to 2/2: one
REQ_OP_WRITE_ZEROES bio per request, no zero-page fallback, no
chunks, no vhost_blk_retry_zeroes().
2. Patch 2: keep the request checks: the feature negotiated, exactly
one segment, known flags only, alignment to the logical block size,
a read-only backend, the range inside the device.
3. Patch 2: keep the cap at UINT_MAX >> SECTOR_SHIFT and also reject a
range above bdev_write_zeroes_sectors() with VIRTIO_BLK_S_IOERR.
4. Patch 2: a backend without WRITE ZEROES (limit 0) gets
VIRTIO_BLK_S_IOERR, not a fallback.
5. Patch 2 message: say that the VMM advertises the feature only for a
backend with WRITE ZEROES and sets max_write_zeroes_sectors from it.
6. Patch 1 stays as it is.
On Tue, 17 Nov 2026 11:09:02 +0100, Alexander Ivanov wrote:
> Alexander Ivanov (2):
> drivers/vhost/blk: fix a flush hang on requests completed after worker
> kill
> drivers/vhost/blk: support VIRTIO_BLK_F_WRITE_ZEROES
1. I agree with Andrey. Once the VMM advertises the feature only for a
backend that has WRITE ZEROES, the zero-page path and the retry are
never taken. My v1 ask for small zero-page chunks goes away with them.
3. num_sectors is 32 bits, so a guest can ask for almost 2 TiB, while
bi_size of one bio is an unsigned int in bytes. This check is needed,
not optional: without it such a request wraps bi_size.
4. A Linux guest then gets -EIO from BLKZEROOUT and does not fall back
to writing zeroes itself. So the VMM has to keep the condition true
when it sets another backend after feature negotiation.
Note on dm-qcow2: it has no REQ_OP_WRITE_ZEROES today. It does not set
num_write_zeroes_bios, so dm sets max_write_zeroes_sectors to 0 and the
VMM will not advertise the feature on it. The feature starts working
on dm-qcow2 only once dm-qcow2 handles WRITE ZEROES.
Thanks.
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
prev parent reply other threads:[~2026-11-17 13:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 10:09 Alexander Ivanov
2026-11-17 10:09 ` [Devel] [PATCH hci-8.1 v3 1/2] drivers/vhost/blk: fix a flush hang on requests completed after worker kill Alexander Ivanov
2026-11-17 10:14 ` no-reply
2026-11-17 10:09 ` [Devel] [PATCH hci-8.1 v3 2/2] drivers/vhost/blk: support VIRTIO_BLK_F_WRITE_ZEROES Alexander Ivanov
2026-11-17 10:18 ` no-reply
2026-11-17 11:32 ` Andrey Zhadchenko
2026-11-17 13:50 ` Konstantin Khorenko
2026-11-17 13:50 ` Konstantin Khorenko [this message]
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=179492344616.136195.11233301242407029938.b4-review@b4 \
--to=khorenko@virtuozzo.com \
--cc=alexander.ivanov@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.