HomeFreeBSD

Add fast path for zfs_ioc_space_snaps() handling of empty_bpobj

Description

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

Details

Provenance
mahrensAuthored on Aug 20 2019, 6:34 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Aug 20 2019, 6:34 PM
Parents
rG3beb0a7694df: Fix lockdep circular locking false positive involving sa_lock
Branches
Unknown
Tags
Unknown