summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2009-06-10 01:21:32 +0000
committerkmacy <kmacy@FreeBSD.org>2009-06-10 01:21:32 +0000
commit50dfd13368b16d34acedc6d54147e83745cc1da8 (patch)
treeb3897d565ab36e24a6dfa4fa1417d37a6fbf86ad /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c
parent899fa45691dcc32bd0e409c03e3784feeaa10125 (diff)
downloadFreeBSD-src-50dfd13368b16d34acedc6d54147e83745cc1da8.zip
FreeBSD-src-50dfd13368b16d34acedc6d54147e83745cc1da8.tar.gz
As far as I can tell systems that have less than 4GB are more often hurt
by prefetched than helped. On i386 systems and systems with less than 4GB, prefetch is now disabled by default. I've added a prefetch enable tunable, to enable prefetching for those systems. The prefetch disable tunable will continue to unconditionally disable prefetching.
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c
index 8dba381..3ff6f5e 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c
@@ -38,6 +38,7 @@
*/
int zfs_prefetch_disable = 0;
+int zfs_prefetch_enable = 0;
/* max # of streams per zfetch */
uint32_t zfetch_max_streams = 8;
@@ -52,6 +53,9 @@ SYSCTL_DECL(_vfs_zfs);
TUNABLE_INT("vfs.zfs.prefetch_disable", &zfs_prefetch_disable);
SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_disable, CTLFLAG_RDTUN,
&zfs_prefetch_disable, 0, "Disable prefetch");
+TUNABLE_INT("vfs.zfs.prefetch_enable", &zfs_prefetch_enable);
+SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_enable, CTLFLAG_RDTUN,
+ &zfs_prefetch_enable, 0, "Enable prefetch for systems with less than 4GB");
SYSCTL_NODE(_vfs_zfs, OID_AUTO, zfetch, CTLFLAG_RW, 0, "ZFS ZFETCH");
TUNABLE_INT("vfs.zfs.zfetch.max_streams", &zfetch_max_streams);
SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RDTUN,
OpenPOWER on IntegriCloud