diff options
author | kmacy <kmacy@FreeBSD.org> | 2010-03-13 21:41:52 +0000 |
---|---|---|
committer | kmacy <kmacy@FreeBSD.org> | 2010-03-13 21:41:52 +0000 |
commit | cd0c2afd360a758bfb7f98c575994c8db5b2815b (patch) | |
tree | 0348e1743980b15f1bc22c02b7514837260d0269 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c | |
parent | 38ae12dc0c3b3fd9d5dcc2e6fd681c943127458d (diff) | |
download | FreeBSD-src-cd0c2afd360a758bfb7f98c575994c8db5b2815b.zip FreeBSD-src-cd0c2afd360a758bfb7f98c575994c8db5b2815b.tar.gz |
Don't bottleneck on acquiring the stream locks - this avoids a massive
drop off in throughput with large numbers of simultaneous reads
MFC after: 7 days
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.c | 28 |
1 files changed, 18 insertions, 10 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 cddc64d..5cc56a9 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 @@ -49,11 +49,11 @@ uint32_t zfetch_block_cap = 256; uint64_t zfetch_array_rd_sz = 1024 * 1024; SYSCTL_DECL(_vfs_zfs); -SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_disable, CTLFLAG_RDTUN, +SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_disable, CTLFLAG_RW, &zfs_prefetch_disable, 0, "Disable prefetch"); 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, +SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RW, &zfetch_max_streams, 0, "Max # of streams per zfetch"); TUNABLE_INT("vfs.zfs.zfetch.min_sec_reap", &zfetch_min_sec_reap); SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, min_sec_reap, CTLFLAG_RDTUN, @@ -338,8 +338,10 @@ top: reset = !prefetched && zs->zst_len > 1; - mutex_enter(&zs->zst_lock); - + if (mutex_tryenter(&zs->zst_lock) == 0) { + rc = 1; + goto out; + } if (zh->zst_offset != zs->zst_offset + zs->zst_len) { mutex_exit(&zs->zst_lock); goto top; @@ -363,8 +365,10 @@ top: reset = !prefetched && zs->zst_len > 1; - mutex_enter(&zs->zst_lock); - + if (mutex_tryenter(&zs->zst_lock) == 0) { + rc = 1; + goto out; + } if (zh->zst_offset != zs->zst_offset - zh->zst_len) { mutex_exit(&zs->zst_lock); goto top; @@ -391,8 +395,10 @@ top: zs->zst_len) && (zs->zst_len != zs->zst_stride)) { /* strided forward access */ - mutex_enter(&zs->zst_lock); - + if (mutex_tryenter(&zs->zst_lock) == 0) { + rc = 1; + goto out; + } if ((zh->zst_offset - zs->zst_offset - zs->zst_stride >= zs->zst_len) || (zs->zst_len == zs->zst_stride)) { mutex_exit(&zs->zst_lock); @@ -408,8 +414,10 @@ top: zs->zst_len) && (zs->zst_len != zs->zst_stride)) { /* strided reverse access */ - mutex_enter(&zs->zst_lock); - + if (mutex_tryenter(&zs->zst_lock) == 0) { + rc = 1; + goto out; + } if ((zh->zst_offset - zs->zst_offset + zs->zst_stride >= zs->zst_len) || (zs->zst_len == zs->zst_stride)) { mutex_exit(&zs->zst_lock); |