ZFS TRIM support committed to HEAD.

Pawel Jakub Dawidek pjd at FreeBSD.org
Sun Sep 23 19:53:49 UTC 2012


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=0 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
> 
> Log:
>   Add TRIM support.
>   
>   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.
>   
>   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).
>   
>   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.
>   
>   Sponsored by:	multiplay.co.uk
>   
>   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.
>   
>   Obtained from:	zfsonlinux
>   Submitted by:	Etienne Dechamps <etienne.dechamps at ovh.net>

-- 
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://tupytaj.pl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20120923/ce7ad84f/attachment.pgp


More information about the freebsd-current mailing list