[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <FF7FC980937D6342B9D289F5F3C7C2625B567044@SHSMSX103.ccr.corp.intel.com>
Date: Tue, 28 Mar 2017 01:43:53 +0000
From: "Liu, Changpeng" <changpeng.liu@...el.com>
To: Christoph Hellwig <hch@....de>
CC: "virtio-dev@...ts.oasis-open.org" <virtio-dev@...ts.oasis-open.org>,
"virtualization@...ts.linux-foundation.org"
<virtualization@...ts.linux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"qemu-devel@...gnu.org" <qemu-devel@...gnu.org>
Subject: RE: [PATCH] virtio-blk: add DISCARD support to virtio-blk driver
> -----Original Message-----
> From: Christoph Hellwig [mailto:hch@....de]
> Sent: Monday, March 27, 2017 10:56 PM
> To: Liu, Changpeng <changpeng.liu@...el.com>
> Cc: virtio-dev@...ts.oasis-open.org; virtualization@...ts.linux-foundation.org; linux-
> kernel@...r.kernel.org; hch@....de; qemu-devel@...gnu.org
> Subject: Re: [PATCH] virtio-blk: add DISCARD support to virtio-blk driver
>
> On Tue, Mar 28, 2017 at 04:39:25PM +0800, Changpeng Liu wrote:
> > Currently virtio-blk driver does not provide discard feature flag, so the
> > filesystems which built on top of the block device will not send discard
> > command. This is okay for HDD backend, but it will impact the performance
> > for SSD backend.
> >
> > Add a feature flag VIRTIO_BLK_F_DISCARD and command
> VIRTIO_BLK_T_DISCARD
> > to extend exist virtio-blk protocol. virtio-blk protocol uses a single
> > 8 bytes descriptor containing type,reserved and sector, currently Linux
> > uses the reserved field as IO priority, here we also re-use the reserved
> > field as number of discard sectors.
>
> Do you have a link to the specification for this feature? At least
> virtio-v1.0 does not seem to specify a discard feature.
Not yet, patch goes first, there are uses who don't want to migrate from virtio-blk to virtio-scsi,
so this feature seems reasonable, the question is that how we should define the specification to
support this feature.
>
> Note that Linux 4.11 and later have support for multi-range discard
> ala ATA TRIM, SCSI UNMAP and NVMe deallocate which might be useful
> here, too.
For support multi-range discard features, the DISCARD command must have data_in buffer, similar with
SCSI UNMAP and NVMe DEALLOCATE commands, maybe 16 bytes aligned descriptors are required for each
DISCARD command.
>
> > + q->limits.discard_zeroes_data = 0;
>
> No need to clear this. Also hopefully this field goes away for 4.12
>
> > + blk_queue_max_discard_segments(q, 1);
>
> No need to set this.
Powered by blists - more mailing lists