summaryrefslogtreecommitdiffstats
path: root/sys/cddl/compat
diff options
context:
space:
mode:
authorsmh <smh@FreeBSD.org>2013-03-21 10:29:05 +0000
committersmh <smh@FreeBSD.org>2013-03-21 10:29:05 +0000
commitee3952780d3120fe00163cf424dc119809c90ac4 (patch)
treeb939cfee4f05ab6d8efe35465719daa56e50fa8e /sys/cddl/compat
parent3db2bd548a96440bd699b58b1b5d6f610b3caff2 (diff)
downloadFreeBSD-src-ee3952780d3120fe00163cf424dc119809c90ac4.zip
FreeBSD-src-ee3952780d3120fe00163cf424dc119809c90ac4.tar.gz
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: https://github.com/dechamps/zfs/commit/17122c31ac7f82875e837019205c21651c05f8cd MFC after: 2 weeks
Diffstat (limited to 'sys/cddl/compat')
-rw-r--r--sys/cddl/compat/opensolaris/sys/time.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/cddl/compat/opensolaris/sys/time.h b/sys/cddl/compat/opensolaris/sys/time.h
index 97c82fc..2e83447 100644
--- a/sys/cddl/compat/opensolaris/sys/time.h
+++ b/sys/cddl/compat/opensolaris/sys/time.h
@@ -35,6 +35,7 @@
#define MILLISEC 1000
#define MICROSEC 1000000
#define NANOSEC 1000000000
+#define TIME_MAX LLONG_MAX
typedef longlong_t hrtime_t;
OpenPOWER on IntegriCloud