diff options
author | kmacy <kmacy@FreeBSD.org> | 2009-06-10 21:05:37 +0000 |
---|---|---|
committer | kmacy <kmacy@FreeBSD.org> | 2009-06-10 21:05:37 +0000 |
commit | 4ff84b99d601aeea965a6a53b65a37b96acef5c7 (patch) | |
tree | e08d47becf7c6991e6a4bf9d175ea52933cbb642 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs | |
parent | 3d458aebb237ed48284381415d395204842369a0 (diff) | |
download | FreeBSD-src-4ff84b99d601aeea965a6a53b65a37b96acef5c7.zip FreeBSD-src-4ff84b99d601aeea965a6a53b65a37b96acef5c7.tar.gz |
use default policy for enabling prefetching unless the TUNABLE is set
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c | 17 | ||||
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c | 7 |
2 files changed, 12 insertions, 12 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c index 75cc6b1..8997a20 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c @@ -158,7 +158,6 @@ static int arc_grow_retry = 60; */ static int arc_min_prefetch_lifespan; -extern int zfs_prefetch_disable; extern int zfs_prefetch_enable; static int arc_dead; @@ -3423,6 +3422,8 @@ arc_lowmem(void *arg __unused, int howto __unused) void arc_init(void) { + int prefetch_tunable_set = 0; + mutex_init(&arc_reclaim_thr_lock, NULL, MUTEX_DEFAULT, NULL); cv_init(&arc_reclaim_thr_cv, NULL, CV_DEFAULT, NULL); mutex_init(&arc_lowmem_lock, NULL, MUTEX_DEFAULT, NULL); @@ -3551,19 +3552,23 @@ arc_init(void) mutex_init(&zfs_write_limit_lock, NULL, MUTEX_DEFAULT, NULL); #ifdef _KERNEL + if (TUNABLE_INT_FETCH("vfs.zfs.prefetch_enable", &zfs_prefetch_enable)) + prefetch_tunable_set = 1; + #ifdef __i386__ - if (zfs_prefetch_enable != 1) { + if (prefetch_tunable_set == 0) { printf("ZFS NOTICE: prefetch is disabled by default on i386" " - add enable to tunable to change.\n" ); - zfs_prefetch_disable=1; + zfs_prefetch_enable=0; } -#endif +#else if ((((uint64_t)physmem * PAGESIZE) < (1ULL << 32)) && - (zfs_prefetch_enable != 1) && (zfs_prefetch_disable != 1)) { + prefetch_tunable_set == 0) { printf("ZFS NOTICE: system has less than 4GB and prefetch enable is not set" "... disabling.\n"); - zfs_prefetch_disable=1; + zfs_prefetch_enable=0; } +#endif /* Warn about ZFS memory and address space requirements. */ if (((uint64_t)physmem * PAGESIZE) < (256 + 128 + 64) * (1 << 20)) { printf("ZFS WARNING: Recommended minimum RAM size is 512MB; " 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 3ff6f5e..d2fad07 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 @@ -37,8 +37,7 @@ * until we can get this working the way we want it to. */ -int zfs_prefetch_disable = 0; -int zfs_prefetch_enable = 0; +int zfs_prefetch_enable = 1; /* max # of streams per zfetch */ uint32_t zfetch_max_streams = 8; @@ -50,10 +49,6 @@ uint32_t zfetch_block_cap = 256; uint64_t zfetch_array_rd_sz = 1024 * 1024; 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"); |