From owner-freebsd-fs@freebsd.org Fri Aug 24 16:26:05 2018 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0588108E5A5 for ; Fri, 24 Aug 2018 16:26:05 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A1D28CF92 for ; Fri, 24 Aug 2018 16:26:05 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 61f7920b-a7ba-11e8-aff6-0b9b8210da61 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 61f7920b-a7ba-11e8-aff6-0b9b8210da61; Fri, 24 Aug 2018 16:26:00 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w7OGPwMW000923; Fri, 24 Aug 2018 10:25:58 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1535127958.1488.31.camel@freebsd.org> Subject: Re: CFT: TRIM Consolodation on UFS/FFS filesystems From: Ian Lepore To: bob prohaska , Kirk McKusick Cc: FreeBSD Filesystems , freebsd-arm@freebsd.org Date: Fri, 24 Aug 2018 10:25:58 -0600 In-Reply-To: <20180824161443.GB2157@www.zefox.net> References: <20180824000637.GA2157@www.zefox.net> <201808240027.w7O0Rh7f062555@chez.mckusick.com> <20180824161443.GB2157@www.zefox.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Aug 2018 16:26:06 -0000 On Fri, 2018-08-24 at 09:14 -0700, bob prohaska wrote: > On Thu, Aug 23, 2018 at 05:27:43PM -0700, Kirk McKusick wrote: > > > > > > Assuming that /dev/mmcsd0s2a is your /usr then when the filesystem > Sorry, the mistake was mine. /dev/mmcsd0s2a was / in that attempt, > which obviously can't work. > > Moving a bootable August 2nd snapshot microSD card to a USB adapter > allowed > root@www:/ # tunefs -t enable /dev/da2s2a > tunefs: issue TRIM to the disk set > > When I remount the device with >  mount -o rw /dev/da2s2a /mnt > the console reports >  WARNING: /mnt: TRIM flag on fs but disk does not support TRIM > I hope that's a consequence of the intervening USB interface. > > I'll swap boot devices when the present buildworld completes and > see if the tunefs command really worked. If it did, then it'll > make sense to update and rebuild to a TRIM-enabled revision.  > > That'll take a couple of days, even if I don't make any mistakes.. > > Sandisk has yet to clarify whether TRIM is supported on microSD. > > Thanks for reading, A usb sdcard reader/writer will definitely mask the trim capability of an sdcard. Aside from that, ALL sdcards support trim on freebsd, regardless of what any support folks at sandisk might tell you. The trim operation is supported in the mmcsd driver by issuing sd erase commands (CMD32/33/38 sequence) which has been in the sd spec from the beginning. That said, it's my experience that different cards implement CMD38 different ways. Some cards treat it like a TRIM -- it's a hint that tells the card "the data in these sectors need not be preserved during future updates to the erase block they're embedded in", and thus they happen very fast and improve efficiency. Other cards treat it as a more synchronous operation, physically erasing the blocks involved while- you-wait, which can be *horrible* for performance on ufs (although potentially it might get better with the consolidation of BIO_DELETEs). -- Ian