From owner-freebsd-fs@FreeBSD.ORG Sun Sep 23 19:53:49 2012 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5839C106566B; Sun, 23 Sep 2012 19:53:49 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 1E8FE8FC0A; Sun, 23 Sep 2012 19:53:48 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id BAE75F94; Sun, 23 Sep 2012 21:52:49 +0200 (CEST) Date: Sun, 23 Sep 2012 21:53:58 +0200 From: Pawel Jakub Dawidek To: freebsd-current@FreeBSD.org Message-ID: <20120923195357.GO1454@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/DkgDsqJFFamjKX0" Content-Disposition: inline X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-fs@FreeBSD.org Subject: ZFS TRIM support committed to HEAD. X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Sep 2012 19:53:49 -0000 --/DkgDsqJFFamjKX0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable FYI, I just committed TRIM support to ZFS, especially useful for SSD-only pools. This is something I implemented long time ago, but was now motivated to get back to it and commit it finally by some great fixes and improvements from the zfsonlinux project (made by Etienne Dechamps). Note that this functionality is turned off by default for now. To turn it on you need to add vfs.zfs.trim_disable=3D0 to /boot/loader.conf. You can see some statistics under kstat.zfs.misc.zio_trim sysctl. Big thanks to multiplay.co.uk for sponsoring this work! BTW. If you find this useful, so tell me about it during EuroBSDcon 2012 in a month that will be held this year in Warsaw, Poland: http://eurobsdcon.org :) On Sun, Sep 23, 2012 at 07:40:58PM +0000, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Sun Sep 23 19:40:58 2012 > New Revision: 240868 > URL: http://svn.freebsd.org/changeset/base/240868 >=20 > Log: > Add TRIM support. > =20 > The code builds a map of regions that were freed. On every write the > code consults the map and eventually removes ranges that were freed > before, but are now overwritten. > =20 > Freed blocks are not TRIMed immediately. There is a tunable that defines > how many txg we should wait with TRIMming freed blocks (64 by default). > =20 > There is a low priority thread that TRIMs ranges when the time comes. > During TRIM we keep in-flight ranges on a list to detect colliding > writes - we have to delay writes that collide with in-flight TRIMs in > case something will be reordered and write will reached the disk before > the TRIM. We don't have to do the same for in-flight writes, as > colliding writes just remove ranges to TRIM. > =20 > Sponsored by: multiplay.co.uk > =20 > This work includes some important fixes and some improvements obtained > from the zfsonlinux project, including TRIMming entire vdevs on pool > create/add/attach and on pool import for spare and cache vdevs. > =20 > Obtained from: zfsonlinux > Submitted by: Etienne Dechamps --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --/DkgDsqJFFamjKX0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlBfaNUACgkQForvXbEpPzQ4GwCfeesqQ5wYR5lL1UjQ195iiggV DAYAoMlf2im9PN669pzrCLUysbdg5uey =8JhV -----END PGP SIGNATURE----- --/DkgDsqJFFamjKX0--