qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Changpeng Liu <changpeng.liu@intel.com>
Cc: virtio-dev@lists.oasis-open.org,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, hch@lst.de, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] virtio-blk: add DISCARD support to virtio-blk driver
Date: Mon, 27 Mar 2017 16:56:26 +0200	[thread overview]
Message-ID: <20170327145625.GA24952@lst.de> (raw)
In-Reply-To: <1490690365-21109-1-git-send-email-changpeng.liu@intel.com>

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.

  parent reply	other threads:[~2017-03-27 14:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-28  8:39 [Qemu-devel] [PATCH] virtio-blk: add DISCARD support to virtio-blk driver Changpeng Liu
2017-03-27 11:34 ` [Qemu-devel] [virtio-dev] " Paolo Bonzini
2017-03-28  1:52   ` Liu, Changpeng
2017-03-27 14:56 ` Christoph Hellwig [this message]
2017-03-28  1:43   ` [Qemu-devel] " Liu, Changpeng
2017-03-27 20:20 ` Stefan Hajnoczi
2017-03-28  2:15   ` Liu, Changpeng
2017-03-28  8:37     ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170327145625.GA24952@lst.de \
    --to=hch@lst.de \
    --cc=changpeng.liu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).