qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Quentin Casasnovas <quentin.casasnovas@oracle.com>
To: Alex Bligh <alex@alex.org.uk>
Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>,
	Eric Blake <eblake@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"qemu-trivial@nongnu.org" <qemu-trivial@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"nbd-general@lists.sourceforge.net"
	<nbd-general@lists.sourceforge.net>,
	"qemu-stable@nongnu.org" <qemu-stable@nongnu.org>,
	qemu block <qemu-block@nongnu.org>
Subject: Re: [Qemu-devel] [Nbd] [PATCH] nbd: fix trim/discard commands with a length bigger than NBD_MAX_BUFFER_SIZE
Date: Tue, 10 May 2016 18:04:38 +0200	[thread overview]
Message-ID: <20160510160438.GD28315@chrystal.uk.oracle.com> (raw)
In-Reply-To: <592DA6FD-75F8-4B7F-AA21-DEA8D591B723@alex.org.uk>

On Tue, May 10, 2016 at 04:49:57PM +0100, Alex Bligh wrote:
> 
> On 10 May 2016, at 16:45, Quentin Casasnovas <quentin.casasnovas@oracle.com> wrote:
> 
> > I'm by no mean an expert in this, but why would the kernel break up those
> > TRIM commands?  After all, breaking things up makes sense when the length
> > of the request is big, not that much when it only contains the request
> > header, which is the case for TRIM commands.
> 
> 1. You are assuming that the only reason for limiting the size of operations is
>    limiting the data transferred within one request. That is not necessarily
>    the case. There are good reasons (if only orthogonality) to have limits
>    in place even where no data is transferred.
> 
> 2. As and when the blocksize extension is implemented in the kernel (it isn't
>    now), the protocol requires it.
> 
> 3. The maximum length of an NBD trim operation is 2^32. The maximum length
>    of a trim operation is larger. Therefore the kernel needs to do at least
>    some breaking up.

Alright, I assumed by 'length of an NBD request', the specification was
talking about the length of.. well, the request as opposed to whatever is
in the length field of the request header.

Is there a use case where you'd want to split up a single big TRIM request
in smaller ones (as in some hardware would not support it or something)?
Even then, it looks like this splitting up would be hardware dependant and
better implemented in block device drivers.

I'm just finding odd that something that fits inside the length field can't
be used.  I do agree with your point number 3, obviously if the lenght
field type doesn't allow something bigger than a u32, then the kernel has
to do some breaking up in that case.

Quentin

  reply	other threads:[~2016-05-10 16:02 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06  8:45 [Qemu-devel] [PATCH] nbd: fix trim/discard commands with a length bigger than NBD_MAX_BUFFER_SIZE Quentin Casasnovas
2016-05-10 14:01 ` Eric Blake
2016-05-10 15:08   ` [Qemu-devel] [Nbd] " Alex Bligh
2016-05-10 15:29     ` Eric Blake
2016-05-10 15:38       ` Alex Bligh
2016-05-10 15:45         ` Quentin Casasnovas
2016-05-10 15:49           ` Alex Bligh
2016-05-10 16:04             ` Quentin Casasnovas [this message]
2016-05-10 16:23               ` Alex Bligh
2016-05-10 16:27                 ` Quentin Casasnovas
2016-05-11  9:38                 ` Paolo Bonzini
2016-05-11 14:08                   ` Eric Blake
2016-05-11 14:55                     ` Alex Bligh
2016-05-11 15:08                       ` Paolo Bonzini
2016-05-10 17:55         ` Paolo Bonzini
2016-05-11 21:12         ` Wouter Verhelst
2016-05-12 15:33           ` Alex Bligh
2016-05-10 15:41       ` Alex Bligh
2016-05-10 15:46         ` Eric Blake
2016-05-10 15:52           ` Alex Bligh
2016-05-10 15:54           ` Quentin Casasnovas
2016-05-10 16:33             ` Quentin Casasnovas
2016-05-10 20:24               ` Eric Blake
2016-05-10 19:13         ` Michał Belczyk
2016-05-11 21:10       ` Wouter Verhelst
2016-05-11 21:06     ` Wouter Verhelst
2016-05-12 15:03       ` Alex Bligh
2016-05-10 20:34 ` [Qemu-devel] " Eric Blake
2016-05-11  8:34   ` Quentin Casasnovas
2016-05-11 14:11     ` Eric Blake

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=20160510160438.GD28315@chrystal.uk.oracle.com \
    --to=quentin.casasnovas@oracle.com \
    --cc=alex@alex.org.uk \
    --cc=eblake@redhat.com \
    --cc=nbd-general@lists.sourceforge.net \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=qemu-trivial@nongnu.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).