# TRIM support on ZFS ZIL/L2ARC-devices



## FLAGEL (Jan 10, 2010)

I know TRIM support is on the 9.0-Release wish list, but how far off from supporting TRIM on the ZFS ZIL/L2ARC-devices we are? And is there any reason why it wouldn't result in much improved performance? I understand that first of all there needs to be support on the hardware-layer and I suppose every driver needs to implement it as well, but what comes after that and what magnitude of effort is required to make it happen?


----------



## trasz@ (Feb 6, 2010)

Just FYI: TRIM functionality is supported by both GEOM (BIO_DELETE) and hardware (ahci(4) driver in FreeBSD-CURRENT).  No idea about how (and if) ZFS can use it, though.


----------



## wonslung (Feb 6, 2010)

I remember someone asking this on the ZFS-DISCUSS mailing list.  I don't remember the exact reason, but i do remember someone saying that it probably wouldn't support trim.  It had something to do with how ZFS works and how trim works.  It was a very technical answer and i can't remember it entirely but your BEST bet to finding this info would be to hit that mailing list and ask, or search the archives and find it.


----------



## aragon (Feb 6, 2010)

UFS support would be welcome though.


----------



## trasz@ (Feb 8, 2010)

So, there is this patch by pjd@:

http://people.freebsd.org/~pjd/patches/ufsdel.patch

It changes three things: it adds TRIM support to md(4), adds something to GEOM, and makes UFS use TRIM.  Some parts of it may be already committed.

Note that this patch might be incompatible with softupdates - after all, if it was ready, it would be committed already.


----------



## andruby (Oct 4, 2010)

Is there an update on this?
I am considering adding an SSD as a ZIL/L2ARC device to speed up ZFS. But if it doesn't support TRIM I fear that the constant writing of new data (because of the ZIL) will make the drive a lot slower..


----------



## wonslung (Oct 9, 2010)

ZFS doesn't support TRIM last time i I checked. I'm not sure it needs trim honestly.

eEspecially for a SLOG (due to how the ZIL works).


----------



## alie (Nov 29, 2011)

*TRIM support on UFS*

Do we have TRIM support on UFS2 FreeBSD 9 ?


----------

