xfs
[Top] [All Lists]

Re: [PATCH] mkfs: add discard support

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] mkfs: add discard support
From: Andi Kleen <andi@xxxxxxxxxxxxxx>
Date: Wed, 07 Oct 2009 22:24:07 +0200
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <20091007044215.GK9464@xxxxxxxxxxxxxxxx> (Dave Chinner's message of "Wed, 7 Oct 2009 15:42:16 +1100")
References: <20091006184758.GA4780@xxxxxxxxxxxxx> <20091007044215.GK9464@xxxxxxxxxxxxxxxx>
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (gnu/linux)
Dave Chinner <david@xxxxxxxxxxxxx> writes:

> On Tue, Oct 06, 2009 at 02:47:58PM -0400, Christoph Hellwig wrote:
>> Call the BLKDISCARD ioctl to mark the whole disk as unused before creating
>> a new filesystem.  This will allow SSDs, Arrays with thin provisioning 
>> support
>> and virtual machines to make smarter allocation decisions.
>
> Good idea, but perhaps the discard should be optional rather than
> unconditional.  My immediate thought was the SOP for setting up
> encrypted devices - fill the empty disk with random data before
> setting up the encrypted device. If you then send it a discard....

This actually doesn't really work for SSDs, because SSDs typically
have more internal capacity than they advertise and when you fill
it up then it will just allocate new blocks and leave some of the
blocks with the existing data around. 

AFAIK there's no way to really reliably delete something physically
on a SSD short of applying a hammer.

For thin provisioning arrays you have similar problems.

So I think Christoph's case of making it default is fine.

-Andi

<Prev in Thread] Current Thread [Next in Thread>