From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: "Martin K. Petersen" <mkp@mkp.net>,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>
Subject: Re: discard_zeroes_data questions
Date: Mon, 9 Nov 2015 15:38:45 -0800 [thread overview]
Message-ID: <20151109233845.GA31524@birch.djwong.org> (raw)
In-Reply-To: <56412776.6080604@sandeen.net>
On Mon, Nov 09, 2015 at 05:08:38PM -0600, Eric Sandeen wrote:
> Hi Martin (and linux-ext4 list...)
>
> tl;dr:
>
> mke2fs today thinks that if discard_zeroes_data == 1 and a BLKDISCARD ioctl
> of the whole device succeeds, then we have guarantees that any blocks read
> back will be full of zero, and we don't need to initialize them to zero. Is
> this ok? (barring crappy hardware, that is).
>
> slightly longer:
>
> Does discard_zeroes_data == 1 mean that a discard *request* will guarantee
> zeroes on a read, or does it mean that a
> discard-request-which-actually-was-executed-and-not-ignored-as-just-a-hint
> will give us back zeroes on a read? (because UNMAP is a hint, right? I
> don't know about SATA trim ...)
>
> I did see 7985090 sd: disable discard_zeroes_data for UNMAP - so I think that
> for v3.19+, on *scsi*, what e2fsprogs is doing is ok (now).
>
> But I'm wondering about dm-thin and SATA, too, so trying to figure out what
> discard_zeroes_data really implies. That after a BLKDISCARD, a read *will*
> return zeros, or that it'll return zeros *iff* the hint is taken?
Last winter I sent in a patch to invalidate the page cache after a discard:
https://marc.info/?l=linux-kernel&m=142249686225748&w=2
...because e2fsck gets confused it discards part of a d_z_d=1 device and gets
non-zeroed buffers back (from the page cache!) immediately after.
But it never went in. Should I resend it? Again? Jens never acted on it.
--D
> I hope that made sense, but I've been communicating badly today. ;)
>
> Thanks,
> -Eric
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-11-09 23:39 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 [this message]
2015-11-10 0:16 ` Martin K. Petersen
2015-11-10 0:15 ` Martin K. Petersen
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=20151109233845.GA31524@birch.djwong.org \
--to=darrick.wong@oracle.com \
--cc=linux-ext4@vger.kernel.org \
--cc=mkp@mkp.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox