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
This commit is contained in:
Pawel Jakub Dawidek 2012-01-20 22:04:59 +00:00
parent ba1fa0f17e
commit b636ebaa6a

View File

@ -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);