Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1609911

Re: [PATCH] virtio-blk: add DISCARD support to virtio-blk driver

From Christoph Hellwig <hch@lst.de>
Newsgroups linux.kernel
Subject Re: [PATCH] virtio-blk: add DISCARD support to virtio-blk driver
Date 2017-03-27 17:00 +0200
Message-ID <tpEhI-17e-31@gated-at.bofh.it> (permalink)
References <tpych-55m-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

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.

> +		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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] virtio-blk: add DISCARD support to virtio-blk driver Changpeng Liu <changpeng.liu@intel.com> - 2017-03-27 10:30 +0200
  Re: [virtio-dev] [PATCH] virtio-blk: add DISCARD support to  virtio-blk driver Paolo Bonzini <pbonzini@redhat.com> - 2017-03-27 13:40 +0200
    RE: [virtio-dev] [PATCH] virtio-blk: add DISCARD support to  virtio-blk driver "Liu, Changpeng" <changpeng.liu@intel.com> - 2017-03-28 04:00 +0200
  Re: [PATCH] virtio-blk: add DISCARD support to virtio-blk driver Christoph Hellwig <hch@lst.de> - 2017-03-27 17:00 +0200
    RE: [PATCH] virtio-blk: add DISCARD support to virtio-blk driver "Liu, Changpeng" <changpeng.liu@intel.com> - 2017-03-28 03:50 +0200
  Re: [PATCH] virtio-blk: add DISCARD support to virtio-blk driver Stefan Hajnoczi <stefanha@gmail.com> - 2017-03-27 22:30 +0200
    RE: [PATCH] virtio-blk: add DISCARD support to virtio-blk driver "Liu, Changpeng" <changpeng.liu@intel.com> - 2017-03-28 04:20 +0200
      Re: [PATCH] virtio-blk: add DISCARD support to virtio-blk driver Stefan Hajnoczi <stefanha@gmail.com> - 2017-03-28 10:40 +0200

csiph-web