Thread (28 messages) 28 messages, 7 authors, 2018-12-05

RE: [PATCH v8] virtio_blk: add discard and write zeroes support

From: Liu, Changpeng <hidden>
Date: 2018-10-16 01:40:41
Also in: linux-block

-----Original Message-----
From: Christoph Hellwig [mailto:hch@infradead.org]
Sent: Monday, October 15, 2018 5:28 PM
To: Daniel Verkamp <redacted>
Cc: virtualization@lists.linux-foundation.org; linux-block@vger.kernel.org;
Michael S. Tsirkin [off-list ref]; Jason Wang [off-list ref];
Jens Axboe [off-list ref]; Stefan Hajnoczi [off-list ref]; Liu,
Changpeng [off-list ref]
Subject: Re: [PATCH v8] virtio_blk: add discard and write zeroes support

On Fri, Oct 12, 2018 at 02:06:28PM -0700, Daniel Verkamp wrote:
quoted
From: Changpeng Liu <redacted>

In commit 88c85538, "virtio-blk: add discard and write zeroes features
to specification" (https://github.com/oasis-tcs/virtio-spec), the virtio
There is some issues in this spec.  For one using the multiple ranges
also for write zeroes is rather inefficient.  Write zeroes really should
use the same format as read and write.
Because there is no length parameter for virtio block specification, adding the
two extra commands will not break the existing specification and driver implementation. 
Also existing Linux implementation for write zeroes will not use multiple segment
at all so there is always one range in practice.
Second the unmap flag isn't properly specified at all, as nothing
says the device may not unmap without the unmap flag.  Please take
a look at the SCSI or NVMe ѕpec for some guidance.
The unmap flag is only used for write zeroes command, as discard command will not 
guarantee the spaces will be zeroed, so adding this flag means (Discard + Write Zeroes),
so this definitely is backend related, the backend implementation can use same code
to implement discard and write zeroes commands.
quoted
+static inline int virtblk_setup_discard_write_zeroes(struct request *req,
+						bool unmap)
Why is this an inline function?
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help