From owner-freebsd-arm@freebsd.org Fri Aug 24 00:57:07 2018 Return-Path: Delivered-To: freebsd-arm@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 2B704109CD59 for ; Fri, 24 Aug 2018 00:57:07 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic305-22.consmr.mail.ne1.yahoo.com (sonic305-22.consmr.mail.ne1.yahoo.com [66.163.185.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC3FF8FC74 for ; Fri, 24 Aug 2018 00:57:06 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: _OBaDFUVM1memAeiNljsTI7C2B1CmAXgkK.UQCwnpqiyt_BlMhYOJvS5fhozKR. vTA.UbSPR8TWjXEgpmVPYoZ6_vv46cRSuVJ2.Rgfn_Z4gZRztU0y5CfHKjbr39sxxPZdU8zQU9oz nnQf6SSlfABn0qNqir2ZwiE91FVUSihD3GZ5NQ1o2.ZuKU.0TLhPHtHiEwXrom32eyhndXEDxU1B zd29sNedXSJGcWkv0KZAdyNyiOX4jWi9mF3ELbADywuCBxbKcvovJPLy9v30ukmxclvFc2jQxQ2U D5HxKodsjT_SZK6TvdAP36hl7nt6Kv.NoQK0Uv5HDobG4g1lba_nh6zpKgXTb5PeOhe9y7tUqvtH najYozYUPx17HPbfbU5rCpotflExjaNnF6fqKxBZiqDQQNp7fJfFNIXWt9rIxeF43uDfeF3lvXJN 34UrXgsciIRwNQJvEaRXnAcYPIhyu3eRZrBtk6W0Ni0ZGAGxbsmS847oESieRzhG3gGjIokdX0Bv .qmLF_zPblMSx4T3nErJcVnZW78IPnXd4Ok0dS0z.aEEseJPnj6ykm26PeTTq5YKHGgEOj6PFSf_ 0xX4UOS1L3dJQD0PmHxg.JEIQzurlirQTQbtRYdkKDHSgkXCxfIh_Fx_P1RBKMqEDUT9RPZTAzmF mWFAZUJ5LhfAKQ4Vmv4rsCA6pGCqYCLICLyiFJhTsQvcXQCOqT7jG5I9z5oXkvRO.JlwWFrnRRUg Dz1x1IGfklbnp.WXBlOgDzyga1oG8X6GoU8m.MEdaMCOrNUvRrCQzbrV1Q4BTPv_5Z.gk4H5QXX. yH8TDZ7xdBOCHQmm5Rd91QoGKJLQsczNU5hhQgqW3cZER1wfqZ0OkkxtpHzuU5o6dNlntv8fkG_3 20ht2WRZLIoIORmk6phS9KLcAGc_gj1fp5qznhrTTObS__hynroT0MJ_Jm3qQwOgQeE6DRqYRcJe n6vsqgSivxfV1XcuyzaFelm2xFHJQwMTgLD0YX079rMefDVaeOt3Ac2ZPrNWki0ajO5Or8QKVcSU Nu_3fHy4sK1eF Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ne1.yahoo.com with HTTP; Fri, 24 Aug 2018 00:57:00 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.105]) ([70.189.131.151]) by smtp414.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 5a8e29ccb534af955f7706ed61837f3d; Fri, 24 Aug 2018 00:56:58 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: CFT: TRIM Consolodation on UFS/FFS filesystems From: Mark Millard In-Reply-To: <20180824000637.GA2157@www.zefox.net> Date: Thu, 23 Aug 2018 17:56:56 -0700 Cc: Kirk McKusick , FreeBSD Filesystems , freebsd-arm@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <1F534D6D-3CA3-4E28-AF24-7AABAB0EDBD3@yahoo.com> References: <20180822004843.GA84687@www.zefox.net> <201808230557.w7N5vvjj038580@chez.mckusick.com> <20180824000637.GA2157@www.zefox.net> To: bob prohaska X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Aug 2018 00:57:07 -0000 On 2018-Aug-23, at 5:06 PM, bob prohaska wrote: > On Wed, Aug 22, 2018 at 10:57:57PM -0700, Kirk McKusick wrote: >>> Date: Tue, 21 Aug 2018 17:48:43 -0700 >>> From: bob prohaska >>> To: Kirk McKusick >>> Cc: FreeBSD Current , >>> FreeBSD Filesystems , >>> bob prohaska >>> Subject: Re: CFT: TRIM Consolodation on UFS/FFS filesystems >>> X-ASK-Info: Message Queued (2018/08/21 17:55:39) >>> X-ASK-Info: Confirmed by User (2018/08/21 18:47:17) >>>=20 >>>=20 >>> Will the new feature be active on a Raspberry Pi 3 using flash=20 >>> on microSD and USB for file systems and swap?=20 >>=20 >> When you create the filesystem (using newfs) you need to specify >> the -t option to request that it send TRIM commands to the underlying >> media. If you have an existing filesystem, you can use the command >> `tunefs -t enable ' to set the = TRIM-request >> flag. When you mount a fiesystem that has been told to send TRIM >> commands, it will send an ioctl to the device asking if it supports >> TRIM. If it replies that it does, then the TRIM commands will be >> sent. If it does not then the kernel will print an error message >> ``WARNING: : TRIM flag on fs but disk does not >> support TRIM'' or ``WARNING: : TRIM flag on fs but >> disk does not confirm that it supports TRIM''. If you get no message >> when you mount, then the drive will accept TRIM commands. Now whether >> it will do anything with them is not clear based on your quote below. >>=20 >=20 > Using > FreeBSD 12.0-ALPHA2 #12 r338122: Tue Aug 21 14:26:18 PDT 2018 >=20 > Alas, no luck. On mount TRIM isn't supported: >=20 > WARNING: /usr: TRIM flag on fs but disk does not support TRIM >=20 > Using tunefs on the microSD produced a different refusal: > # tunefs -t enable /dev/mmcsd0s2a > tunefs: issue TRIM to the disk set > tunefs: /dev/mmcsd0s2a: failed to open disk for writing > I tried with the device both ro and rw, same error. I > expected "not supported", rather than "failed to open". > If there's a mistake please tell me. For a UFS example: # umount /mnt pine64# tunefs -tenable /dev/mmcsd0s2a tunefs: issue TRIM to the disk set # mount -o noatime /dev/mmcsd0s2a /mnt # tunefs -p /mnt tunefs: POSIX.1e ACLs: (-a) disabled tunefs: NFSv4 ACLs: (-N) enabled tunefs: MAC multilabel: (-l) disabled tunefs: soft updates: (-n) enabled tunefs: soft update journaling: (-j) disabled tunefs: gjournal: (-J) disabled tunefs: trim: (-t) enabled tunefs: maximum blocks per file in a cylinder group: (-e) 4096 tunefs: average file size: (-f) 16384 tunefs: average number of files in a directory: (-s) 64 tunefs: minimum percentage of free space: (-m) 8% tunefs: space to hold for metadata blocks: (-k) 6408 tunefs: optimization preference: (-o) time tunefs: volume label: (-L) PINE642GBroot Then during a svnupdate -r477847 /usr/ports : dT: 1.006s w: 1.000s L(q) ops/s r/s kBps ms/r w/s kBps ms/w d/s kBps = ms/d %busy Name 1265 144 1 32 3064 105 2597 2114 38 326 = 32.2 104.2| mmcsd0 Note the "d/s kBps ms/d" figures: it is actively in use. Context: This is from head -r337400 before the changes for how things work. The root file system and swap partition are on a USB SSD (on a powered hub). But: mmcsd0: 32GB MFG 07/2017 by 3 SD> at mmc0 = 50.0MHz/4bit/32768-block It is a SanDisk microsdhc card that I did the test with. > Not sure if this is true of all possible storage devices, but > the Sandisk Ultra microSD and Sandisk Extreme USB appear to be > non-starters. >=20 USB of various vintages has its own issues for the commands allowed. But microsd cards that support it should allow TRIM. (If some work worse with TRIM enabled is another matter. For the old way TRIM was handled by FreeBSD may be nearly certain that such works worse for such media.) =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)