All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: "linux-ext4\@vger.kernel.org" <linux-ext4@vger.kernel.org>
Subject: Re: discard_zeroes_data questions
Date: Mon, 09 Nov 2015 19:15:43 -0500	[thread overview]
Message-ID: <yq1twouwvyo.fsf@sermon.lab.mkp.net> (raw)
In-Reply-To: <56412776.6080604@sandeen.net> (Eric Sandeen's message of "Mon, 9 Nov 2015 17:08:38 -0600")

>>>>> "Eric" == Eric Sandeen <sandeen@sandeen.net> writes:

Eric,

Eric> Does discard_zeroes_data == 1 mean that a discard *request* will
Eric> guarantee zeroes on a read, or does it mean that a
Eric> discard-request-which-actually-was-executed-and-not-ignored-as-just-a-hint
Eric> will give us back zeroes on a read?  (because UNMAP is a hint,
Eric> right?  I don't know about SATA trim ...)

For SCSI we only set d_z_d if the device is using WRITE SAME which
provides hard guarantees (i.e. the device will physically write zeroes
to any blocks of a request that can not be successfully unmapped).

The SATA spec is full of fail but RAID controller vendors as well as
Microsoft require a device that reports DRAT/RZAT to do the right
thing. I.e. offer guarantees above and beyond what the spec can
provide.

We don't entirely trust the "Designed for Windows" sticker. So for d_z_d
to be set on a SATA device in Linux it must report DRAT/RZAT *and* be
explicitly whitelisted. I am not aware of any problems with the drives
we currently have enabled.

Eric> But I'm wondering about dm-thin and SATA, too, so trying to figure
Eric> out what discard_zeroes_data really implies.  That after a
Eric> BLKDISCARD, a read *will* return zeros, or that it'll return zeros
Eric> *iff* the hint is taken?

Can't speak for dm-thin. But the intent is that discard_zeroes_data is a
hard guarantee and not a hint. So any stacked driver that sets it must
provide the right guarantees.

-- 
Martin K. Petersen	Oracle Linux Engineering

      parent reply	other threads:[~2015-11-10  0:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-09 23:08 discard_zeroes_data questions Eric Sandeen
2015-11-09 23:38 ` Darrick J. Wong
2015-11-10  0:16   ` Martin K. Petersen
2015-11-10  0:15 ` Martin K. Petersen [this message]

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=yq1twouwvyo.fsf@sermon.lab.mkp.net \
    --to=martin.petersen@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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.