]> git.proxmox.com Git - mirror_zfs.git/commit
Add fast path for zfs_ioc_space_snaps() handling of empty_bpobj
authorMatthew Ahrens <mahrens@delphix.com>
Tue, 20 Aug 2019 18:34:52 +0000 (11:34 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 20 Aug 2019 18:34:52 +0000 (11:34 -0700)
commit325d288c5d536227010ff4dfcf66df89f123d166
tree86807360e97638a06b6cce82a168b75a36a3caaf
parent3beb0a7694df5d1d4314179147aaa1d40b63fe76
Add fast path for zfs_ioc_space_snaps() handling of empty_bpobj

When there are many snapshots, calls to zfs_ioc_space_snaps() (e.g. from
`zfs destroy -nv pool/fs@snap1%snap10000`) can be very slow, resulting
in poor performance because we are holding the dp_config_rwlock the
entire time, blocking spa_sync() from continuing.  With around ten
thousand snapshots, we've seen up to 500 seconds in this ioctl,
iterating over up to 50,000,000 bpobjs, ~99% of which are the empty
bpobj.

By creating a fast path for zfs_ioc_space_snaps() handling of the
empty_bpobj, we can achieve a ~5x performance improvement of this ioctl
(when there are many snapshots, and the deadlist is mostly
empty_bpobj's).

Reviewed-by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
External-issue: DLPX-58348
Closes #8744
include/sys/dsl_deadlist.h
module/zfs/dsl_deadlist.c
module/zfs/dsl_destroy.c