All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@virtuozzo.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org,
	nbd-general@lists.sourceforge.net
Cc: alex@alex.org.uk, eblake@redhat.com, kwolf@redhat.com,
	pbonzini@redhat.com, stefanha@redhat.com,
	w@uter.beEric Blake <eblake@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] proto: add 'shift' extension.
Date: Tue, 27 Sep 2016 12:43:11 +0300	[thread overview]
Message-ID: <27bd2bc9-b879-81ef-c7b6-31335e6be84f@virtuozzo.com> (raw)
In-Reply-To: <1474893981-5302-1-git-send-email-vsementsov@virtuozzo.com>

On 09/26/2016 03:46 PM, Vladimir Sementsov-Ogievskiy wrote:
> This extension allows big requests for TRIM and WRITE_ZEROES through
> special 'shift' parameter, which means that offset and length should be
> shifted left by several bits.
>
> This is needed for efficient clearing large regions of the disk (up to
> the whole disk).
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
>
> Here mentioned WRITE_ZEROES command which is only an experemental
> extension for now.
>
> To dicuss:
> NBD_OPT_SHIFT Data. It can be reduced to 8 bits actually... Are some
>    reserved bits needed here?
>
>  doc/proto.md | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/doc/proto.md b/doc/proto.md
> index 2de3a6a..6fd1b16 100644
> --- a/doc/proto.md
> +++ b/doc/proto.md
> @@ -682,6 +682,8 @@ The field has the following format:
>    experimental `WRITE_ZEROES` [extension](https://github.com/yoe/nbd/blob/extension-write-zeroes/doc/proto.md).
>  - bit 7, `NBD_FLAG_SEND_DF`: defined by the experimental `STRUCTURED_REPLY`
>    [extension](https://github.com/yoe/nbd/blob/extension-structured-reply/doc/proto.md).
> +- bit 8, `NBD_FLAG_SEND_SHIFT` : exposes support for `NBD_CMD_FLAG_SHIFT` and
> +  `NBD_OPT_SHIFT`
>  
>  Clients SHOULD ignore unknown flags.
>  
> @@ -765,6 +767,15 @@ of the newstyle negotiation.
>  
>      Defined by the experimental `INFO` [extension](https://github.com/yoe/nbd/blob/extension-info/doc/proto.md).
>  
> +- `NBD_OPT_SHIFT` (10)
> +
> +    Defines shift used to calculate request offset and length if
> +    `NBD_CMD_FLAG_SHIFT` is set.
> +
> +    Data:
> +
> +    - 32 bits, shift (unsigned); Must not be larger than 32.
> +
>  #### Option reply types
>  
>  These values are used in the "reply type" field, sent by the server
> @@ -872,7 +883,13 @@ valid may depend on negotiation during the handshake phase.
>    [extension](https://github.com/yoe/nbd/blob/extension-write-zeroes/doc/proto.md).
>  - bit 2, `NBD_CMD_FLAG_DF`; defined by the experimental `STRUCTURED_REPLY`
>    [extension](https://github.com/yoe/nbd/blob/extension-structured-reply/doc/proto.md).
> -
> +- bit 3, `NBD_CMD_FLAG_SHIFT`; This flag is valid for `NBD_CMD_TRIM` and
> +  `NBD_CMD_WRITE_ZEROES`. If this flag is set the server shifts request
> +  *length* and *offset* left by N bits, where N is defined by `NBD_OPT_SHIFT`
> +  option or is assumed to be 16 bits by default if `NBD_OPT_SHIFT` option is
> +  not specified. If after shift `(offset + length)` exceeds disk size, length
> +  should be reduced to `(<disk size> - offset)`. However, `(offset + length)`
> +  must not exceed disk size by more than `(1 << N) - 1`.
>  
>  #### Request types
>  
We could go in a different direction and export flag
'has_zero_init' which will report that the storage is
initialized with all zeroes at the moment. In this
case mirroring code will not fall into this
branch.

Den

  parent reply	other threads:[~2016-09-27 12:16 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-26 12:46 [Qemu-devel] [PATCH] proto: add 'shift' extension Vladimir Sementsov-Ogievskiy
2016-09-26 12:51 ` Paolo Bonzini
2016-09-26 13:53   ` Vladimir Sementsov-Ogievskiy
2016-09-26 13:54     ` Paolo Bonzini
2016-09-26 14:06       ` Alex Bligh
2016-09-26 20:35   ` Eric Blake
2016-09-26 14:05 ` Alex Bligh
2016-09-26 20:21 ` Eric Blake
2016-09-26 23:41   ` [Qemu-devel] [Nbd] " Wouter Verhelst
2016-09-27  7:36     ` Alex Bligh
2016-09-27  9:43 ` Denis V. Lunev [this message]
2016-09-27 10:15   ` [Qemu-devel] " Paolo Bonzini
2016-09-27 10:25     ` Denis V. Lunev
2016-09-27 12:07       ` Paolo Bonzini
2016-09-27 13:28         ` Denis V. Lunev
2016-09-27 17:04           ` Paolo Bonzini
2016-09-27 18:59             ` Denis V. Lunev
2016-09-28  8:34               ` Kevin Wolf
2016-09-28  8:37                 ` Denis V. Lunev
2016-09-28  8:56                   ` Kevin Wolf
2016-09-28  9:00                     ` Vladimir Sementsov-Ogievskiy
2016-09-28  9:32                       ` Kevin Wolf
2016-09-27 13:46         ` Denis V. Lunev

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=27bd2bc9-b879-81ef-c7b6-31335e6be84f@virtuozzo.com \
    --to=den@virtuozzo.com \
    --cc=alex@alex.org.uk \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=nbd-general@lists.sourceforge.net \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@virtuozzo.com \
    --cc=w@uter.beEric \
    /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.