From: Ric Wheeler <rwheeler@redhat.com>
To: Greg Freemyer <greg.freemyer@gmail.com>
Cc: Mark Lord <liml@rtr.ca>, Matthew Wilcox <matthew@wil.cx>,
Christoph Hellwig <hch@infradead.org>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
jens.axboe@oracle.com, james.bottomley@hansenpartnership.com,
willy@wil.cx, jgarzik@pobox.com, sandeen@redhat.com,
linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1/4] block: Allow devices to indicate whether discarded blocks are zeroed
Date: Mon, 23 Nov 2009 12:02:48 -0500 [thread overview]
Message-ID: <4B0AC038.6050606@redhat.com> (raw)
In-Reply-To: <87f94c370911230854v46c1dc35g417a54b8a415ba16@mail.gmail.com>
On 11/23/2009 11:54 AM, Greg Freemyer wrote:
> On Mon, Nov 23, 2009 at 11:37 AM, Ric Wheeler<rwheeler@redhat.com> wrote:
>> On 11/21/2009 09:43 PM, Mark Lord wrote:
>>>
>>> Matthew Wilcox wrote:
>>>>
>>>> On Sat, Nov 21, 2009 at 05:13:56AM -0500, Christoph Hellwig wrote:
>>>>>
>>>>> On Fri, Nov 20, 2009 at 09:45:21PM -0500, Martin K. Petersen wrote:
>>>>>>
>>>>>> The discard ioctl is used by mkfs utilities to clear a block device
>>>>>> prior to putting metadata down. However, not all devices return zeroed
>>>>>> blocks after a discard. Some drives return stale data, potentially
>>>>>> containing old superblocks. It is therefore important to know whether
>>>>>> discarded blocks are properly zeroed.
>>>>>
>>>>> At least for mkfs.xfs we make sure to still zero the important areas
>>>>> after the TRIM ioctl anyway.
>>>>
>>>> Could you change that to zero _before_ the TRIM?
>>>
>>> ..
>>>
>>>
>>> Hopefully not for the drives that *don't* guarantee zeros after TRIM.
>>> Eg. most existing ones, including all of the Indilinx chipset drives.
>>>
>>> Cheers
>>>
>>
>> Note that writing to a block after a discard (write or trim) changes the
>> state of that block back to allocated (mapped) in the target. Basically,
>> that would seem to make the trim redundant and irrelevant.
>>
>> You can zero before the discard but that can still fail is the device
>> returns garbage for a trim'ed block I think,
>>
>> Ric
>
> I understood the mkfs process to be:
>
> - discard / trim 100% of the block device
> - write zeros to the relatively small group of blocks that the
> filesystem assumes will be zero'd.
>
> Seems like the only reasonable way to handle it.
>
> Greg
I agree - the discard of the whole device is a good idea.
I just want to make clear that "discard block X; write block X with zeroed data"
undoes the discard in general :-)
ric
next prev parent reply other threads:[~2009-11-23 16:58 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-21 2:45 Thin provisioning fixes Martin K. Petersen
2009-11-21 2:45 ` [PATCH 1/4] block: Allow devices to indicate whether discarded blocks are zeroed Martin K. Petersen
2009-11-21 10:13 ` Christoph Hellwig
2009-11-21 19:58 ` Matthew Wilcox
2009-11-22 2:43 ` Mark Lord
2009-11-23 16:37 ` Ric Wheeler
2009-11-23 16:54 ` Greg Freemyer
2009-11-23 17:02 ` Ric Wheeler [this message]
2009-11-23 17:03 ` Christoph Hellwig
2009-11-23 17:50 ` Eric Sandeen
2009-11-23 17:05 ` Christoph Hellwig
2009-11-21 12:50 ` Ric Wheeler
2009-11-21 20:17 ` Martin K. Petersen
2009-11-21 2:45 ` Martin K. Petersen
2009-11-21 2:45 ` [PATCH 2/4] sd: WRITE SAME(16) / UNMAP support Martin K. Petersen
2009-11-21 2:45 ` Martin K. Petersen
2009-11-21 2:45 ` [PATCH 3/4] libata: Report zeroed read after Trim and max discard size Martin K. Petersen
2009-11-21 10:49 ` Christoph Hellwig
2009-11-21 20:16 ` Martin K. Petersen
2009-11-24 14:35 ` Christoph Hellwig
2009-11-24 15:20 ` Mark Lord
2009-11-24 15:21 ` Christoph Hellwig
2009-11-21 2:45 ` Martin K. Petersen
2009-11-21 2:45 ` [PATCH 4/4] libata: Fix garbled Trim payload Martin K. Petersen
2009-11-21 10:47 ` Christoph Hellwig
2009-11-21 19:50 ` Martin K. Petersen
2009-11-21 2:45 ` Martin K. Petersen
2009-11-21 4:56 ` Thin provisioning fixes Eric Sandeen
2009-11-21 6:08 ` Martin K. Petersen
2009-11-21 6:55 ` Martin K. Petersen
2009-11-26 10:59 ` Christoph Hellwig
2009-11-26 11:01 ` Jens Axboe
2009-11-26 11:05 ` Christoph Hellwig
2009-11-26 15:13 ` Mark Lord
2009-11-26 15:14 ` Mark Lord
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=4B0AC038.6050606@redhat.com \
--to=rwheeler@redhat.com \
--cc=greg.freemyer@gmail.com \
--cc=hch@infradead.org \
--cc=james.bottomley@hansenpartnership.com \
--cc=jens.axboe@oracle.com \
--cc=jgarzik@pobox.com \
--cc=liml@rtr.ca \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=matthew@wil.cx \
--cc=sandeen@redhat.com \
--cc=willy@wil.cx \
/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.