X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n97KMj9m208358 for ; Wed, 7 Oct 2009 15:22:46 -0500 X-ASG-Debug-ID: 1254947050-6e5201350000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from one.firstfloor.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 77579BD9945 for ; Wed, 7 Oct 2009 13:24:10 -0700 (PDT) Received: from one.firstfloor.org (one.firstfloor.org [213.235.205.2]) by cuda.sgi.com with ESMTP id HD3KcIEcKeSzYxir for ; Wed, 07 Oct 2009 13:24:10 -0700 (PDT) Received: from basil.firstfloor.org (p5B3CB740.dip0.t-ipconnect.de [91.60.183.64]) by one.firstfloor.org (Postfix) with ESMTP id 9687F1FC802A; Wed, 7 Oct 2009 22:24:08 +0200 (CEST) Received: by basil.firstfloor.org (Postfix, from userid 1000) id 00E96B1803; Wed, 7 Oct 2009 22:24:07 +0200 (CEST) To: Dave Chinner Cc: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] mkfs: add discard support Subject: Re: [PATCH] mkfs: add discard support From: Andi Kleen References: <20091006184758.GA4780@infradead.org> <20091007044215.GK9464@discord.disaster> Date: Wed, 07 Oct 2009 22:24:07 +0200 In-Reply-To: <20091007044215.GK9464@discord.disaster> (Dave Chinner's message of "Wed, 7 Oct 2009 15:42:16 +1100") Message-ID: <87iqerymu0.fsf@basil.nowhere.org> User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Barracuda-Connect: one.firstfloor.org[213.235.205.2] X-Barracuda-Start-Time: 1254947051 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.11118 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Dave Chinner 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