qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: ronnie sahlberg <ronniesahlberg@gmail.com>
To: Peter Lieven <pl@kamp.de>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCHv2 02/11] iscsi: read unmap info from block limits vpd page
Date: Fri, 5 Jul 2013 00:11:28 -0700	[thread overview]
Message-ID: <CAN05THRuV2oCmthn3Y8esk20bV3s8=yd2uSQxG8bbPL+2V2NdQ@mail.gmail.com> (raw)
In-Reply-To: <05F80B98-FC6D-4562-8B23-45495ADE6A01@kamp.de>

The device MIGHT map or anchor the blocks after the unmap  but it may
only do so if the blocks that become mapped are all zero.

So I think you can  safely assume that if lbprz==1 then it will always
read back as zero no matter what happens internally in the target.

Either the block becomes unmapped/deallocated and then it will read
back as zero,
or the blocks is automatically re-mapped to anchored/mapped again
but this can only happen if the mapped block is all zero so once again
it will still read back as all zero.

===

4.7.3.5 Autonomous LBA transitions
A device server may perform the following actions at any time:
a) transition any deallocated LBA to mapped;
b) transition any anchored LBA to mapped; or
c) transition any deallocated LBA to anchored.
If the LBPRZ bit in the READ CAPACITY (16) parameter data (see 5.16.2)
is set to one, and a mapped LBA
references a logical block that contains:
a) user data with all bits set to zero; and
Working Draft SCSI Block Commands – 3 (SBC-3)
27T10/BSR INCITS 514 Revision 35d
15 May 2013
b) protection information, if any, set to FFFF_FFFF_FFFF_FFFFh,
then the device server may transition that mapped LBA to anchored or
deallocated at any time.
The logical block provisioning st

On Thu, Jul 4, 2013 at 2:07 PM, Peter Lieven <pl@kamp.de> wrote:
>
> Am 04.07.2013 um 14:37 schrieb Paolo Bonzini <pbonzini@redhat.com>:
>
>> Il 03/07/2013 23:23, Peter Lieven ha scritto:
>>> BDC is not used. I had an implementation that sent multiple descriptors out, but
>>> at least for my storage the maximum unmap counts not for each descriptors, but for all
>>> together. So in this case we do not need the field at all. I forgot to remove it.
>>>
>>> discard and write_zeroes will both only send one request up to max_unmap in size.
>>>
>>> apropos write_zeroes: do you know if UNMAP is guaranteed to unmap data if lbprz == 1?
>>
>> Yes.  On the other hand note that WRITE_SAME should be guaranteed _not_
>> to unmap if lbprz == 0 and you do WRITE_SAME with UNMAP and a zero
>> payload, but I suspect there may be buggy targets here.
>>
>>> I have read in the specs something that the target might unmap the blocks or not touch them at all.
>>> Maybe you have more information.
>>
>> That's even true of UNMAP itself, actually. :)
>>
>> The storage can always "upgrade" a block from unmapped to anchored and
>> from anchored to allocated, so UNMAP can be a no-op and still comply
>> with the standard.
>
> My concern was, if I UNMAP a block and lbprz == 1 is it guaranteed that it reads
> as zero afterwards? Regardless if the target decides to "upgrade" the block or do
> not unmap the block?
>
> Peter
>

  parent reply	other threads:[~2013-07-05  7:11 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-27 13:11 [Qemu-devel] [PATCHv2 00/11] iscsi/qemu-img/block-migration enhancements Peter Lieven
2013-06-27 13:11 ` [Qemu-devel] [PATCHv2 01/11] iscsi: add logical block provisioning information to iscsilun Peter Lieven
2013-07-01 13:35   ` Stefan Hajnoczi
2013-07-01 16:08     ` Peter Lieven
2013-07-10  9:19   ` Kevin Wolf
2013-06-27 13:11 ` [Qemu-devel] [PATCHv2 02/11] iscsi: read unmap info from block limits vpd page Peter Lieven
2013-07-03  3:43   ` ronnie sahlberg
2013-07-03 21:23     ` Peter Lieven
2013-07-04 12:37       ` Paolo Bonzini
2013-07-04 21:07         ` Peter Lieven
2013-07-05  6:28           ` Paolo Bonzini
2013-07-05  7:11           ` ronnie sahlberg [this message]
2013-07-06 22:15             ` Peter Lieven
2013-07-06 23:23               ` ronnie sahlberg
2013-07-10  9:23   ` Kevin Wolf
2013-07-10  9:25   ` Kevin Wolf
2013-06-27 13:11 ` [Qemu-devel] [PATCHv2 03/11] iscsi: add bdrv_co_is_allocated Peter Lieven
2013-07-01 13:46   ` Stefan Hajnoczi
2013-07-01 16:00     ` Peter Lieven
2013-07-10  9:41   ` Kevin Wolf
2013-07-10 13:49     ` Peter Lieven
2013-07-10 14:43       ` Kevin Wolf
2013-07-10 14:49         ` Peter Lieven
2013-07-10 14:54           ` Kevin Wolf
2013-06-27 13:11 ` [Qemu-devel] [PATCHv2 04/11] iscsi: add bdrv_co_write_zeroes Peter Lieven
2013-07-10  9:54   ` Kevin Wolf
2013-06-27 13:11 ` [Qemu-devel] [PATCHv2 05/11] block: add bdrv_write_zeroes() Peter Lieven
2013-07-10  9:56   ` Kevin Wolf
2013-06-27 13:11 ` [Qemu-devel] [PATCHv2 06/11] block/raw: add bdrv_co_write_zeroes Peter Lieven
2013-07-10  9:57   ` Kevin Wolf
2013-06-27 13:11 ` [Qemu-devel] [PATCHv2 07/11] iscsi: let bdrv_create conditionally zero out the device Peter Lieven
2013-07-01 13:58   ` Stefan Hajnoczi
2013-07-01 20:20   ` Paolo Bonzini
2013-07-01 21:36     ` Peter Lieven
2013-07-02  9:22       ` Paolo Bonzini
2013-07-02 10:36         ` Peter Lieven
2013-07-02 10:49           ` Paolo Bonzini
2013-07-02 10:56             ` Peter Lieven
2013-07-02 11:04               ` Paolo Bonzini
2013-07-02 11:18                 ` Peter Lieven
2013-07-10 10:14   ` Kevin Wolf
2013-07-10 13:52     ` Peter Lieven
2013-06-27 13:11 ` [Qemu-devel] [PATCHv2 08/11] block-migration: efficiently encode zero blocks Peter Lieven
2013-07-01 14:13   ` Stefan Hajnoczi
2013-07-01 15:55     ` Peter Lieven
2013-07-02  7:40       ` Stefan Hajnoczi
2013-07-02 10:51         ` Paolo Bonzini
2013-07-01 16:09     ` Peter Lieven
2013-07-02  7:36       ` Stefan Hajnoczi
2013-06-27 13:11 ` [Qemu-devel] [PATCHv2 09/11] iscsi: factor out sector conversions Peter Lieven
2013-07-10 11:29   ` Kevin Wolf
2013-07-10 14:07     ` Peter Lieven
2013-06-27 13:11 ` [Qemu-devel] [PATCHv2 10/11] iscsi: ignore aio_discard if unsupported Peter Lieven
2013-07-10 11:33   ` Kevin Wolf
2013-07-10 14:04     ` Peter Lieven
2013-07-10 14:28       ` Kevin Wolf
2013-07-10 14:49         ` Peter Lieven
2013-07-10 14:58           ` Kevin Wolf
2013-07-10 20:31             ` Peter Lieven
2013-06-27 13:11 ` [Qemu-devel] [PATCHv2 11/11] iscsi: assert that sectors are aligned to LUN blocksize Peter Lieven
2013-07-01 14:35   ` Stefan Hajnoczi
2013-07-01 15:59     ` Peter Lieven
2013-07-02  7:44       ` Stefan Hajnoczi
2013-07-02  8:28         ` Peter Lieven
2013-07-02 10:44           ` Paolo Bonzini
2013-07-02 10:49             ` Peter Lieven
2013-07-02 10:53               ` Paolo Bonzini
2013-07-10 11:38   ` Kevin Wolf
2013-07-10 14:02     ` Peter Lieven

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='CAN05THRuV2oCmthn3Y8esk20bV3s8=yd2uSQxG8bbPL+2V2NdQ@mail.gmail.com' \
    --to=ronniesahlberg@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pl@kamp.de \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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).