From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Snitzer Subject: Re: Ext4 and xfs problems in dm-thin on allocation and discard Date: Tue, 19 Jun 2012 09:16:49 -0400 Message-ID: <20120619131649.GA6811@redhat.com> References: <4FDF9EBE.2030809@shiftmail.org> <20120619015745.GJ25389@dastard> <20120619031241.GA3884@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-ext4-owner@vger.kernel.org To: =?utf-8?B?THVrw6HFoQ==?= Czerner Cc: Dave Chinner , Spelic , device-mapper development , linux-ext4@vger.kernel.org, xfs@oss.sgi.com List-Id: dm-devel.ids On Tue, Jun 19 2012 at 2:32am -0400, Luk=C3=A1=C5=A1 Czerner wrote: > On Mon, 18 Jun 2012, Mike Snitzer wrote: >=20 > > Date: Mon, 18 Jun 2012 23:12:42 -0400 > > From: Mike Snitzer > > To: Dave Chinner > > Cc: Spelic , > > device-mapper development , > > linux-ext4@vger.kernel.org, xfs@oss.sgi.com > > Subject: Re: Ext4 and xfs problems in dm-thin on allocation and dis= card > >=20 > > On Mon, Jun 18 2012 at 9:57pm -0400, > > Dave Chinner wrote: > >=20 > > > On Mon, Jun 18, 2012 at 11:33:50PM +0200, Spelic wrote: > > > > > > > Please note that since I am above MD raid5 (I believe this is t= he > > > > reason), the passdown of discards does not work, as my dmesg sa= ys: > > > > [160508.497879] device-mapper: thin: Discard unsupported by dat= a > > > > device (dm-1): Disabling discard passdown. > > > > but AFAIU, unless there is a thinp bug, this should not affect = the > > > > unmapping of thin blocks by fstrimming xfs... and in fact ext4 = is > > > > able to do that. > > >=20 > > > Does ext4 report that same error? > >=20 > > That message says the underlying device doesn't support discards > > (because it is an MD device). But the thinp device still has disca= rds > > enabled -- it just won't pass the discards down to the underlying d= ata > > device. > >=20 > > So yes, it'll happen with ext4 -- it is generated when the thin-poo= l > > device is loaded (which happens independent of the filesystem that = is > > layered ontop). > >=20 > > The discards still inform the thin-pool that the corresponding exte= nts > > are no longer allocated. >=20 > So do I understand correctly that even though the discard came > through and thinp took advantage of it it still returns EOPNOTSUPP ? No, not correct. Why are you assuming this? I must be missing something from this discussion that led you there. > This seems rather suboptimal. IIRC there was a discussion to add an > option to enable/disable sending discard in thinp target down > to the device. >=20 > So maybe it might be a bit smarter than that and actually > enable/disable discard pass through depending on the underlying > support, so we do not blindly send discard down to the device even > though it does not support it. Yes, that is what we did. Discards are enabled my default (including discard passdown), but if th= e underlying data device doesn't support discards then the discards will not be passed down. And here are the feature controls that can be provided when loading the thin-pool's DM table: ignore_discard: disable discard no_discard_passdown: don't pass discards down to the data device -EOPNOTSUPP is only ever returned if 'ignore_discard' is provided. -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" i= n the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id q5JDGx8v094094 for ; Tue, 19 Jun 2012 08:17:00 -0500 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 4ViFjdzfrvEMblff for ; Tue, 19 Jun 2012 06:16:58 -0700 (PDT) Date: Tue, 19 Jun 2012 09:16:49 -0400 From: Mike Snitzer Subject: Re: Ext4 and xfs problems in dm-thin on allocation and discard Message-ID: <20120619131649.GA6811@redhat.com> References: <4FDF9EBE.2030809@shiftmail.org> <20120619015745.GJ25389@dastard> <20120619031241.GA3884@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: xfs-bounces@oss.sgi.com Errors-To: xfs-bounces@oss.sgi.com To: =?utf-8?B?THVr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