All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Daniel Verkamp <dverkamp@chromium.org>,
	Jens Axboe <axboe@kernel.dk>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	virtualization@lists.linux-foundation.org,
	linux-block@vger.kernel.org,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Changpeng Liu <changpeng.liu@intel.com>
Subject: Re: [PATCH v8] virtio_blk: add discard and write zeroes support
Date: Mon, 29 Oct 2018 19:03:44 +0100	[thread overview]
Message-ID: <bf8fbe85-37a0-be6b-bfd0-da45dfaf7920@redhat.com> (raw)
In-Reply-To: <20181026082640.GA1147@infradead.org>

On 26/10/2018 10:26, Christoph Hellwig wrote:
> On Fri, Oct 26, 2018 at 01:28:54AM +0200, Paolo Bonzini wrote:
>> On 15/10/2018 11:27, Christoph Hellwig wrote:
>>> There is some issues in this spec.  For one using the multiple ranges
>>> also for write zeroes is rather inefficient.  Write zeroes really should
>>> use the same format as read and write.
>>
>> What makes it inefficient?
> 
> We require a memory allocation for each write zeroes instead of encoding
> the lba/len in the command.

Oh, I see.  That's not a spec issue, the lba/length descriptor can be
included in the same buffer as the rest of the command; using
kmalloc_array even for a single-bio REQ_OP_WRITE_ZEROES is a choice made
by this patch, I suppose for simplicity.

It is possible to special case single-bio unmap and write zeroes so that
they don't call virtblk_setup_discard_write_zeroes and avoid
RQF_SPECIAL_PAYLOAD.

Thanks,

Paolo

WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	virtualization@lists.linux-foundation.org,
	linux-block@vger.kernel.org,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Changpeng Liu <changpeng.liu@intel.com>
Subject: Re: [PATCH v8] virtio_blk: add discard and write zeroes support
Date: Mon, 29 Oct 2018 19:03:44 +0100	[thread overview]
Message-ID: <bf8fbe85-37a0-be6b-bfd0-da45dfaf7920@redhat.com> (raw)
In-Reply-To: <20181026082640.GA1147@infradead.org>

On 26/10/2018 10:26, Christoph Hellwig wrote:
> On Fri, Oct 26, 2018 at 01:28:54AM +0200, Paolo Bonzini wrote:
>> On 15/10/2018 11:27, Christoph Hellwig wrote:
>>> There is some issues in this spec.  For one using the multiple ranges
>>> also for write zeroes is rather inefficient.  Write zeroes really should
>>> use the same format as read and write.
>>
>> What makes it inefficient?
> 
> We require a memory allocation for each write zeroes instead of encoding
> the lba/len in the command.

Oh, I see.  That's not a spec issue, the lba/length descriptor can be
included in the same buffer as the rest of the command; using
kmalloc_array even for a single-bio REQ_OP_WRITE_ZEROES is a choice made
by this patch, I suppose for simplicity.

It is possible to special case single-bio unmap and write zeroes so that
they don't call virtblk_setup_discard_write_zeroes and avoid
RQF_SPECIAL_PAYLOAD.

Thanks,

Paolo

  parent reply	other threads:[~2018-10-29 18:03 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-06  4:19 [PATCH v6] virtio_blk: add DISCARD and WRIET ZEROES commands support Changpeng Liu
2018-06-07 13:10 ` Stefan Hajnoczi
2018-06-07 23:07   ` Liu, Changpeng
2018-06-08 10:20     ` Stefan Hajnoczi
2018-06-11  3:37       ` Liu, Changpeng
2018-06-12 16:05         ` Stefan Hajnoczi
2018-08-28 22:25 ` [PATCH v7] virtio_blk: add discard and write zeroes support Daniel Verkamp
2018-10-12 21:06 ` [PATCH v8] " Daniel Verkamp
2018-10-12 21:06   ` Daniel Verkamp
2018-10-15  0:54   ` Michael S. Tsirkin
2018-10-15  0:54     ` Michael S. Tsirkin
2018-10-15  9:21   ` Ming Lei
2018-10-15  9:27   ` Christoph Hellwig
2018-10-15  9:27     ` Christoph Hellwig
2018-10-15 23:16     ` Daniel Verkamp
2018-10-15 23:16       ` Daniel Verkamp
2018-10-16  1:45       ` Liu, Changpeng
2018-10-16  1:45         ` Liu, Changpeng
2018-10-16  1:40     ` Liu, Changpeng
2018-10-16  1:40       ` Liu, Changpeng
2018-10-25 23:28     ` Paolo Bonzini
2018-10-25 23:28       ` Paolo Bonzini
2018-10-26  8:26       ` Christoph Hellwig
2018-10-26  8:26         ` Christoph Hellwig
2018-10-29  3:21         ` Liu, Changpeng
2018-10-29  3:21           ` Liu, Changpeng
2018-10-29 18:03         ` Paolo Bonzini [this message]
2018-10-29 18:03           ` Paolo Bonzini
2018-10-26  8:08   ` Stefan Hajnoczi
2018-10-26  8:08     ` Stefan Hajnoczi
2018-10-26 14:47     ` Michael S. Tsirkin
2018-10-26 14:47       ` Michael S. Tsirkin
2018-10-29  5:05       ` Stefan Hajnoczi
2018-10-29  5:05         ` Stefan Hajnoczi
2018-11-01 21:25         ` Michael S. Tsirkin
2018-11-01 21:25           ` Michael S. Tsirkin
2018-11-01 22:18           ` Daniel Verkamp
2018-11-01 22:18             ` Daniel Verkamp
2018-11-01 22:40 ` [PATCH v9] " Daniel Verkamp
2018-11-01 22:40   ` Daniel Verkamp
2018-11-01 23:43   ` Dongli Zhang
2018-11-01 23:43     ` Dongli Zhang
2018-11-02 18:25     ` Daniel Verkamp
2018-11-02 18:25       ` Daniel Verkamp
2018-11-02  4:17   ` Stefan Hajnoczi
2018-11-02  4:17     ` Stefan Hajnoczi
2018-12-05  9:46     ` Liu, Changpeng
2018-12-05  9:46       ` Liu, Changpeng
2018-12-05 13:41       ` Michael S. Tsirkin
2018-12-05 13:41         ` Michael S. Tsirkin

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=bf8fbe85-37a0-be6b-bfd0-da45dfaf7920@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=changpeng.liu@intel.com \
    --cc=dverkamp@chromium.org \
    --cc=hch@infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=stefanha@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.