linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: keith.busch@intel.com (Keith Busch)
Subject: [PATCH] nvme-pci: Add Write Zero support to Intel 660p
Date: Fri, 2 Nov 2018 08:21:15 -0600	[thread overview]
Message-ID: <20181102142114.GA24372@localhost.localdomain> (raw)
In-Reply-To: <20181102060815.GA16583@lst.de>

On Fri, Nov 02, 2018@07:08:15AM +0100, Christoph Hellwig wrote:
> On Thu, Nov 01, 2018@08:38:08AM -0600, Keith Busch wrote:
> > We currently use DSM Deallocate for REQ_OP_WRITE_ZEROES. We don't care
> > if the blocks are actually deallocated. We only care if reading them
> > back determinisitically returns 0's, and DLFEAT tells us if we can rely
> > on that behavior.
> 
> No, DLFEAT _only_ tells you the value you read from actually deallocated
> blocks.  From the DLFEAT description:
> 
> "Bits 2:0 indicate the values read from a deallocated logical block and its
> metadata (excluding protection information). The values for this field have
> the following meanings:"
> 
> And from Section 6.7:
> 
> "This command is advisory; a compliant controller may choose to take no
> action based on information provided."
> 
> "Attribute ? Deallocate (AD): If set to ?1?, then the NVM subsystem may
> deallocate all provided ranges. The data returned for a deallocated range
> is specified in section 6.7.1.1."

Okay, that wording is unfortunate and the feature is useless if that's
how it can be interpreted.

The "advisory" parts were originally directed toward the Context
Attributes referring to access type and frequency.

The intended behavior for Deallocate was a controller picks exactly
one behavior: return 0's, 1's, or the previous written data. It was
never intended, as far as I know, for a controller to return read
data differently for any given range after returning success to a DSM
Deallocate command.

That must be at least part of the motivation for Write Zeroes adding
deallocate support.

  reply	other threads:[~2018-11-02 14:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-26 22:41 [PATCH] nvme-pci: Add Write Zero support to Intel 660p Gwendal Grignou
2018-10-26 22:58 ` Keith Busch
2018-10-27  7:44   ` Christoph Hellwig
2018-10-27  9:19     ` Chaitanya Kulkarni
2018-10-29 15:24     ` Keith Busch
2018-11-01  5:27       ` Christoph Hellwig
2018-11-01 14:38         ` Keith Busch
2018-11-02  6:08           ` Christoph Hellwig
2018-11-02 14:21             ` Keith Busch [this message]
2018-11-03  8:21               ` Christoph Hellwig

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=20181102142114.GA24372@localhost.localdomain \
    --to=keith.busch@intel.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).