summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2012-01-20 22:04:59 +0000
committerpjd <pjd@FreeBSD.org>2012-01-20 22:04:59 +0000
commit39957b7340f1e5781191b7b97b4fb30eafd9b7f3 (patch)
tree0ca008e62dcbac42c1f0710cf20d158e4b788167
parent62f2fd64bb9bb613ca366ff4cd1c0f3d6338113c (diff)
downloadFreeBSD-src-39957b7340f1e5781191b7b97b4fb30eafd9b7f3.zip
FreeBSD-src-39957b7340f1e5781191b7b97b4fb30eafd9b7f3.tar.gz
By default turn off prefetch when listing snapshots.
In my tests it makes listing snapshots 19% faster with cold cache and 47% faster with warm cache. MFC after: 1 week
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
index 882bf02e..fa09170 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
@@ -81,6 +81,12 @@
CTASSERT(sizeof(zfs_cmd_t) < IOCPARM_MAX);
+static int snapshot_list_prefetch;
+SYSCTL_DECL(_vfs_zfs);
+TUNABLE_INT("vfs.zfs.snapshot_list_prefetch", &snapshot_list_prefetch);
+SYSCTL_INT(_vfs_zfs, OID_AUTO, snapshot_list_prefetch, CTLFLAG_RW,
+ &snapshot_list_prefetch, 0, "Prefetch data when listing snapshots");
+
static struct cdev *zfsdev;
extern void zfs_init(void);
@@ -2044,7 +2050,7 @@ zfs_ioc_snapshot_list_next(zfs_cmd_t *zc)
int error;
top:
- if (zc->zc_cookie == 0)
+ if (snapshot_list_prefetch && zc->zc_cookie == 0)
(void) dmu_objset_find(zc->zc_name, dmu_objset_prefetch,
NULL, DS_FIND_SNAPSHOTS);
OpenPOWER on IntegriCloud