[Devel] [PATCH hci-8.1 v2 2/2] drivers/vhost/blk: support VIRTIO_BLK_F_WRITE_ZEROES
Konstantin Khorenko
khorenko at virtuozzo.com
Fri Nov 13 22:55:17 MSK 2026
I can apply it with these fixes on my side:
- the VMM paragraph says what a large max_write_zeroes_sectors costs
and that our QEMU does not advertise the feature yet
On Fri, 13 Nov 2026 09:27:44 +0100, Alexander Ivanov wrote:
> The VMM must advertise blk_size equal to the backend logical block
> size, max_write_zeroes_sectors aligned to it and at most 8388607, and
> max_write_zeroes_seg = 1.
Added: "A request is zeroed one chunk at a time and holds
vhost_blk_flush() until its last chunk, so a small
max_write_zeroes_sectors keeps vhost ioctls short on backends without
WRITE ZEROES. Our QEMU does not advertise the feature yet."
Why: dm-qcow2 and dm-ploop have no WRITE ZEROES, so a 4 GiB request is
a long row of 4 MiB zero-page chunks, and every generic vhost ioctl
QEMU sends, SET_FEATURES among them, waits uninterruptibly in
vhost_blk_flush() until the last one. Only the VMM can bound that. The
v1 reply also asked to say that QEMU has to follow: its "write-zeroes"
property is off and it fills no write-zeroes config field.
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
More information about the Devel
mailing list