[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [virtio-comment] [PATCH v3] virtio-blk: add discard and write zeroes features to specification
Hi Changpeng, On 03/06/18 03:50, Changpeng Liu wrote: > Existing virtio-blk protocol doesn't have DISCARD/WRITE ZEROES support, > this will impact the performance when using SSD backend over file systems. > > Here is the proposal to extend existing virtio-blk protocol to support > DISCARD/WRITE ZEROES commands. > > Basic idea here is using 16 Bytes payload to support 1 descriptor, users > can put several segments together with 1 DISCARD/WRITE ZEROES command. > > struct virtio_blk_discard_write_zeroes { > le64 sector; > le32 num_sectors; > struct { > le32 unmap:1; > le32 reserved:31; > } flags; > }; > > For the purpose to support such feature, we need to introduce 2 new feature > flags: VIRTIO_BLK_F_DISCARD/VIRTIO_BLK_F_WRITE_ZEROES, and 2 new command > types: VIRTIO_BLK_T_DISCARD/VIRTIO_BLK_T_WRITE_ZEROES. Also we introduce > several new parameters in the configuration space of virtio-blk: > max_discard_sectors/max_discard_seg/max_write_zeroes_sectors. > These parameters will tell the OS what's the granularity when > issuing such commands. > > If both DISCARD and WRITE ZEROES are supported, unmap flag bit maybe used > for WRITE ZEROES command with DISCARD bit enabled. > > Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> > --- > content.tex | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- > 1 file changed, 81 insertions(+), 3 deletions(-) virtio-scsi already supports discard and write zeroes, and virtio-scsi can be backed by SSDs. Can you please describe the use case in the commit message (in a few words) that needs discard / write zeroes but is ill-served by virtio-scsi? I believe the spec (and implementations) should be conservative about feature duplication unless there's a good reason for it. I don't doubt you have a good reason; can you please name it in the commit message? I'm not questioning your motives, I'd just like to see them documented in the commit log. Thank you, Laszlo
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]