freebsd-nq/sys/cddl
Steven Hartland 89e5b43079 TRIM cache devices based on time instead of TXGs.
Currently, the trim module uses the same algorithm for data and cache
devices when deciding to issue TRIM requests, based on how far in the
past the TXG is.

Unfortunately, this is not ideal for cache devices, because the L2ARC
doesn't use the concept of TXGs at all. In fact, when using a pool for
reading only, the L2ARC is written but the TXG counter doesn't
increase, and so no new TRIM requests are issued to the cache device.

This patch fixes the issue by using time instead of the TXG number as
the criteria for trimming on cache devices. The basic delay principle
stays the same, but parameters are expressed in seconds instead of
TXGs. The new parameters are named trim_l2arc_limit and
trim_l2arc_batch, and both default to 30 second.

Reviewed by:	pjd (mentor)
Approved by:	pjd (mentor)
Obtained from:	17122c31ac
MFC after:	2 weeks
2013-03-21 10:29:05 +00:00
..
boot/zfs MFV r245512: 2013-02-09 06:39:28 +00:00
compat/opensolaris TRIM cache devices based on time instead of TXGs. 2013-03-21 10:29:05 +00:00
contrib/opensolaris TRIM cache devices based on time instead of TXGs. 2013-03-21 10:29:05 +00:00
dev Add FBT for PowerPC DTrace. Also, clean up the DTrace assembly code, 2013-03-18 05:30:18 +00:00