From owner-freebsd-current@freebsd.org Wed Aug 22 01:47:30 2018 Return-Path: Delivered-To: freebsd-current@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 3A7EE10869AD for ; Wed, 22 Aug 2018 01:47:30 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic307-12.consmr.mail.ne1.yahoo.com (sonic307-12.consmr.mail.ne1.yahoo.com [66.163.190.35]) (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 A782279701 for ; Wed, 22 Aug 2018 01:47:29 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: PzlNgWcVM1nfv54fVFlGkdOZtXpZO12TrhvOINihD0USMY.RKQSy6zisoaUsnyf zTtaTjVtdzZOF0sTGzdI2LzeCcOEj53kFkXz1BtzwZ2PRgeLN4Z8U3_23jlJkutBHMAdBL.L24Ty NnBD3uu4fwYQm_klVQCk__3uM7sPcgfCMXTFAAw5Dolerov_HEdHxmR8GSxV09wbwKrIwvcOwreU xPCDXN2ihn70A0JdL5XnJwnMjFDPHHYNOOdN16rgdy3GXUphio2tCXOj6JG66D0LUWaWbFa6N7rP VLGSnMIsYmQL7PO5WyLpxoPhk7AMkkBAdsJp8vPkbN.WRkKJB6093K5t4hmZTLggC359CMHZcKVf H0hNn0pCwRj6hM_PIW3H.QRZ_AVpj8muaQKMlY23B6Eyc.X0YhJENHLhqhQ54bM309rTaph0yDaX PvphoicstmDKt6EUL4pVZWV0HGJQsWX4bShwdmkxW1wL5MMYQOitoBjRV5bFxv0lucaFMkbXqRHX jCHljFUiBh6KKEJscgoHZeYtp62EeWF62UpPcuqK8e6YmLpd6FctQ8kC6.hMv8Wf8s3iIcZ3XPOT GjZnWwmTjcdm0kXmSbDDXtnSYiqA96k3A4dfHUyPH29awrZ_hR1y4Wx_p4O20Bbncc7DdynzzrkH FsaVzgXBtcWczydpyXp_xy1HvUBTUjyqwEMfdMUOUeJDveX4npysZa_8..nR2FapFxWT17MJTDmf XFrQyeTtqCesFCWWLENV8TK85sZF56veLyhIopiPSHBAOFBKYJoWEs.tCZQT4a0dxnb1h9nggqnW mHRMEPHFOo2gQUUtVoWfygxltCUzN4kwQrWxJnULTQcX8Zroh6Txb.zZIQQIj6uobg2XzCEBUq5x BqA0zMRyxohVOqqutP7T0JS1RRBAcddVm_wzjvwJ4fi3NHC8qYd_Ys3.3.tnYVt99YRwFciEUB1v doWZGgLnvSazlZU5RMO7H883T9CXsc5xQV9RDt3KoBuCFVR5xU5CGiRjHmPKNZEfyoBfJ6mvJCwk fyNLltgzCr204AmGfW.xAwafjy7Z9CdYI_ruBHg-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Wed, 22 Aug 2018 01:47:22 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.105]) ([70.189.131.151]) by smtp424.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 85037b62be960f7fc7e74c550f4f30b7; Wed, 22 Aug 2018 01:47:21 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: CFT: TRIM Consolodation on UFS/FFS filesystems Message-Id: <170C703D-AA75-4EC9-93BA-D2CF3A7D6D5E@yahoo.com> Date: Tue, 21 Aug 2018 18:47:19 -0700 To: bob prohaska , FreeBSD Current X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2018 01:47:30 -0000 bob prohaska fbsd at www.zefox.net wrote on Wed Aug 22 00:48:33 UTC 2018 : > On Mon, Aug 20, 2018 at 12:40:56PM -0700, Kirk McKusick wrote: > > . . . > >=20 > > To enable TRIM consolodation either use `sysctl = vfs.ffs.dotrimcons=3D1' > > or just set the `dotrimcons' variable in sys/ufs/ffs/ffs_alloc.c to = 1. > >=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 Even if a USB device contains appropriate storage in it, that does not mean that the USB protocol in use has a way to request the operation. (Similarly for other multiple stages of translation than USB protocol being involved.) For FreeBSD, UFS and ZFS have support if the requests can be sent through all the stages. Swap partitions do not have support even if the device does through all the stages. (See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206048 for why I do not otherwise mention swap files.) RPI3's use (some subset of?) USB 2.0 as I remember. I'm not aware of the protocol supporting such. (I'm no expert, however.) Thus, UFS and ZFS end up unable to do TRIM for such contexts as I understand things. > Can the feature be turned on using one of the conf files in /etc?=20 At least for UFS there are commands for configuration, such as tunefs and newfs that include control of such points. I do not remember for ZFS. As I remember if you enable it on UFS but it actually can not do it for how the device is connected, FreeBSD reports the issue at mount or some such. I've used a SSD both directly via SATA and via a USB enclosure, the same partitions/file systems across the uses. Only when it was SATA-style-use did TRIM work. > According to Sandisk,=20 > "All microSD or USB drives are flash memory and does support the TRIM = command, however,=20 > you will not notice any difference after running TRIM command on = memory cards or USB=20 > drives. TRIM command is basically used for SSD and Hard drives." This gets back into what the protocols in use allow to be requested when direct communication with the flash is not in use. (More may be involved.) > The "you will not notice any difference...." qualification makes me = slightly uncertain > the reply was well-informed, but if there's any hope of success I'd = like to try it. > >=46rom time to time there seem to be traffic jams among flash devices = on the RPI3, it > would a pleasant surprise if this feature helps. I'll note that gstat with -d allows watching the "BIO_DELETE" operations (in FreeBSD terms). One can see if they are what time is being spent on. Quoting g_bio(9) : BIO_DELETE Indicates that a certain range of data = is no longer used and that it can be erased = or freed as the underlying technology = supports. Technologies like flash adaptation = layers can arrange to erase the relevant blocks = before they will become reassigned and = cryptographic devices may want to fill random bits = into the range to reduce the amount of data = available for attack. In your rpi3/2 experiments if you watch the column sequence: d/s kBps ms/d I expect that you will find that they stay at: 0 0 0.0 indicating lack of use. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)