[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [PATCH v4] virtio-blk: add discard and write zeroes features to specification
On Fri, Mar 09, 2018 at 10:44:23AM +0800, 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(-) Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Attachment:
signature.asc
Description: PGP signature
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]