From: Spelic Subject: Re: Ext4 and xfs problems in dm-thin on allocation and discard Date: Tue, 19 Jun 2012 23:37:54 +0200 Message-ID: <4FE0F132.2080207@shiftmail.org> References: <4FDF9EBE.2030809@shiftmail.org> <20120619015745.GJ25389@dastard> <20120619031241.GA3884@redhat.com> <20120619131649.GA6811@redhat.com> <20120619133041.GB6811@redhat.com> <4FE0840F.2050704@shiftmail.org> <20120619144413.GA7225@redhat.com> <20120619184858.GA8841@redhat.com> <20120619200631.GL25389@dastard> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: Mike Snitzer , Spelic , =?windows-1252?Q?Luk=E1=9A_Czerner?= , device-mapper development , linux-ext4@vger.kernel.org, xfs@oss.sgi.com To: Dave Chinner Return-path: Received: from blade3.isti.cnr.it ([194.119.192.19]:1272 "EHLO blade3.isti.cnr.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752009Ab2FSVh2 (ORCPT ); Tue, 19 Jun 2012 17:37:28 -0400 Received: from [10.0.55.100] ([94.36.116.228]) by mx.isti.cnr.it (PMDF V6.5-x6 #31988) with ESMTPSA id <01OGVZ7QWSMYODSON8@mx.isti.cnr.it> for linux-ext4@vger.kernel.org; Tue, 19 Jun 2012 23:37:19 +0200 (MEST) In-reply-to: <20120619200631.GL25389@dastard> Sender: linux-ext4-owner@vger.kernel.org List-ID: On 06/19/12 22:06, Dave Chinner wrote: > On Tue, Jun 19, 2012 at 02:48:59PM -0400, Mike Snitzer wrote: >> On Tue, Jun 19 2012 at 10:44am -0400, >> Mike Snitzer wrote: >> >>> On Tue, Jun 19 2012 at 9:52am -0400, >>> Spelic wrote: >>> >>>> I do not know what is the mechanism for which xfs cannot unmap >>>> blocks from dm-thin, but it really can't. >>>> If anyone has dm-thin installed he can try. This is 100% >>>> reproducible for me. >>> I was initially surprised by this considering the thinp-test-suite does >>> test a compilebench workload against xfs and ext4 using online discard >>> (-o discard). >>> >>> But I just modified that test to use a thin-pool with 'ignore_discard' >>> and the test still passed on both ext4 and xfs. >>> >>> So there is more work needed in the thinp-test-suite to use blktrace >>> hooks to verify that discards are occuring when the compilebench >>> generated files are removed. >>> >>> I'll work through that and report back. >> blktrace shows discards for both xfs and ext4. >> >> But in general xfs is issuing discards with much smaller extents than >> ext4 does, e.g.: > THat's normal when you use -o discard - XFS sends extremely > fine-grained discards as the have to be issued during the checkpoint > commit that frees the extent. Hence they can't be aggregated like is > done in ext4. > > As it is, no-one really should be using -o discard - it is extremely > inefficient compared to a background fstrim run given that discards > are unqueued, blocking IOs. It's just a bad idea until the lower > layers get fixed to allow asynchronous, vectored discards and SATA > supports queued discards... > Could it be that the thin blocksize is larger than the discard granularity by xfs so nothing ever gets unmapped? I have tried thin pools with the default blocksize (64k afair with lvm2) and 1MB. HOWEVER I also have tried fstrim on xfs, and that is also not capable to unmap things from the dm-thin. What is the granularity with fstrim in xfs? Sorry I can't access the machine right now; maybe tomorrow, or in the weekend.