freebsd-dev/sys/cddl/compat/opensolaris
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
..
kern Switch the vm_object mutex to be a rwlock. This will enable in the 2013-03-09 02:32:23 +00:00
rpc Our libc doesn't implement control method for XDR (only kernel does) and it 2009-08-20 00:05:29 +00:00
sys TRIM cache devices based on time instead of TXGs. 2013-03-21 10:29:05 +00:00