freebsd-nq/include/sys
Serapheim Dimitropoulos 8d103d8856 OpenZFS 8604 - Simplify snapshots unmounting code
Authored by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Ported-by: Don Brady <don.brady@delphix.com>

Every time we want to unmount a snapshot (happens during snapshot
deletion or renaming) we unnecessarily iterate through all the
mountpoints in the VFS layer (see zfs_get_vfs).

The current patch completely gets rid of that code and changes
the approach while keeping the behavior of that code path the
same. Specifically, it puts a hold on the dataset/snapshot and
gets its vfs resource reference directly, instead of linearly
searching for it. If that reference exists we attempt to amount
it.

With the above change, it became obvious that the nvlist
manipulations that we do (add_boolean and add_nvlist) take a
significant amount of time ensuring uniqueness of every new
element even though they don't have too. Thus, we updated the
patch so those nvlists are not trying to enforce the uniqueness
of their elements.

A more complete analysis of the problem solved by this patch
can be found below:
https://sdimitro.github.io/post/snap-unmount-perf/

OpenZFS-issue: https://www.illumos.org/issues/8604
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/126118fb
2018-02-08 15:29:44 -08:00
..
crypto
fm Extend deadman logic 2018-01-25 13:40:38 -08:00
fs OpenZFS 7431 - ZFS Channel Programs 2018-02-08 15:28:18 -08:00
lua OpenZFS 7431 - ZFS Channel Programs 2018-02-08 15:28:18 -08:00
sysevent OpenZFS 8959 - Add notifications when a scrub is paused or resumed 2018-01-17 10:31:00 -08:00
abd.h OpenZFS 8416 - abd.h is not C++ friendly 2017-06-30 11:11:01 -07:00
arc_impl.h Support re-prioritizing asynchronous prefetches 2017-12-21 09:13:06 -08:00
arc.h Fix ARC hit rate 2018-01-08 09:52:36 -08:00
avl_impl.h
avl.h Remove dead code from AVL tree 2017-10-05 19:28:00 -07:00
blkptr.h OpenZFS 8067 - zdb should be able to dump literal embedded block pointer 2017-07-07 11:28:01 -07:00
bplist.h
bpobj.h
bptree.h
bqueue.h
dbuf.h OpenZFS 7531 - Assign correct flags to prefetched buffers 2017-11-11 20:24:34 -08:00
ddt.h Native Encryption for ZFS on Linux 2017-08-14 10:36:48 -07:00
dmu_impl.h
dmu_objset.h Change os->os_next_write_raw to work per txg 2018-02-02 11:44:53 -08:00
dmu_send.h Free objects when receiving full stream as clone 2017-10-10 15:30:51 -07:00
dmu_traverse.h Native Encryption for ZFS on Linux 2017-08-14 10:36:48 -07:00
dmu_tx.h OpenZFS 8997 - ztest assertion failure in zil_lwb_write_issue 2018-01-26 20:19:46 -08:00
dmu_zfetch.h
dmu.h Encryption Stability and On-Disk Format Fixes 2018-02-02 11:37:16 -08:00
dnode.h Raw sends must be able to decrease nlevels 2018-02-02 11:43:11 -08:00
dsl_bookmark.h
dsl_crypt.h Encryption Stability and On-Disk Format Fixes 2018-02-02 11:37:16 -08:00
dsl_dataset.h OpenZFS 8600 - ZFS channel programs - snapshot 2018-02-08 15:29:24 -08:00
dsl_deadlist.h
dsl_deleg.h Native Encryption for ZFS on Linux 2017-08-14 10:36:48 -07:00
dsl_destroy.h OpenZFS 7431 - ZFS Channel Programs 2018-02-08 15:28:18 -08:00
dsl_dir.h OpenZFS 7431 - ZFS Channel Programs 2018-02-08 15:28:18 -08:00
dsl_pool.h Sequential scrub and resilvers 2017-11-15 17:27:01 -08:00
dsl_prop.h
dsl_scan.h Sequential scrub and resilvers 2017-11-15 17:27:01 -08:00
dsl_synctask.h
dsl_userhold.h
edonr.h
efi_partition.h
frame.h Suppress incorrect objtool warnings 2017-12-07 10:28:50 -08:00
hkdf.h Encryption patch follow-up 2017-10-11 16:54:48 -04:00
Makefile.am OpenZFS 7431 - ZFS Channel Programs 2018-02-08 15:28:18 -08:00
metaslab_impl.h
metaslab.h
mmp.h Add callback for zfs_multihost_interval 2017-07-25 13:22:20 -04:00
mntent.h
multilist.h
nvpair_impl.h
nvpair.h
pathname.h
policy.h
range_tree.h Sequential scrub and resilvers 2017-11-15 17:27:01 -08:00
refcount.h OpenZFS 8081 - Compiler warnings in zdb 2017-10-27 12:46:35 -07:00
rrwlock.h
sa_impl.h
sa.h
sdt.h Add line info and SET_ERROR() to ZFS debug log 2017-07-25 23:09:48 -07:00
sha2.h
skein.h
spa_boot.h
spa_checksum.h
spa_impl.h Extend deadman logic 2018-01-25 13:40:38 -08:00
spa.h Extend deadman logic 2018-01-25 13:40:38 -08:00
space_map.h
space_reftree.h
sysevent.h OpenZFS 6939 - add sysevents to zfs core for commands 2017-07-12 21:28:13 -07:00
trace_acl.h
trace_arc.h Support re-prioritizing asynchronous prefetches 2017-12-21 09:13:06 -08:00
trace_common.h
trace_dbgmsg.h Add line info and SET_ERROR() to ZFS debug log 2017-07-25 23:09:48 -07:00
trace_dbuf.h Crash in dbuf_evict_one with DTRACE_PROBE 2017-08-09 11:04:41 -07:00
trace_dmu.h tx_waited -> tx_dirty_delayed in trace_dmu.h 2018-01-31 16:13:26 -08:00
trace_dnode.h
trace_multilist.h
trace_txg.h
trace_zil.h OpenZFS 8585 - improve batching done in zil_commit() 2017-12-05 09:39:16 -08:00
trace_zio.h
trace_zrlock.h
trace.h
txg_impl.h
txg.h OpenZFS 8063 - verify that we do not attempt to access inactive txg 2017-05-10 13:52:22 -04:00
u8_textprep_data.h
u8_textprep.h
uberblock_impl.h OpenZFS 8491 - uberblock on-disk padding to reserve space for smoothly merging zpool checkpoint & MMP in ZFS 2017-07-24 13:47:51 -04:00
uberblock.h Multi-modifier protection (MMP) 2017-07-13 13:54:00 -04:00
uio_impl.h
unique.h
uuid.h
vdev_disk.h
vdev_file.h
vdev_impl.h Sequential scrub and resilvers 2017-11-15 17:27:01 -08:00
vdev_raidz_impl.h Revert raidz_map and _col structure types 2018-01-09 14:46:52 -08:00
vdev_raidz.h
vdev.h Extend deadman logic 2018-01-25 13:40:38 -08:00
xvattr.h
zap_impl.h
zap_leaf.h
zap.h
zcp_global.h OpenZFS 7431 - ZFS Channel Programs 2018-02-08 15:28:18 -08:00
zcp_iter.h OpenZFS 7431 - ZFS Channel Programs 2018-02-08 15:28:18 -08:00
zcp_prop.h OpenZFS 7431 - ZFS Channel Programs 2018-02-08 15:28:18 -08:00
zcp.h OpenZFS 8600 - ZFS channel programs - snapshot 2018-02-08 15:29:24 -08:00
zfeature.h
zfs_acl.h
zfs_context.h OpenZFS 7431 - ZFS Channel Programs 2018-02-08 15:28:18 -08:00
zfs_ctldir.h
zfs_debug.h Add line info and SET_ERROR() to ZFS debug log 2017-07-25 23:09:48 -07:00
zfs_delay.h
zfs_dir.h
zfs_fuid.h
zfs_ioctl.h OpenZFS 8604 - Simplify snapshots unmounting code 2018-02-08 15:29:44 -08:00
zfs_onexit.h
zfs_ratelimit.h
zfs_rlock.h
zfs_sa.h
zfs_stat.h
zfs_vfsops.h OpenZFS 7431 - ZFS Channel Programs 2018-02-08 15:28:18 -08:00
zfs_vnops.h
zfs_znode.h OpenZFS 8081 - Compiler warnings in zdb 2017-10-27 12:46:35 -07:00
zil_impl.h OpenZFS 8909 - 8585 can cause a use-after-free kernel panic 2017-12-28 10:18:04 -08:00
zil.h OpenZFS 8909 - 8585 can cause a use-after-free kernel panic 2017-12-28 10:18:04 -08:00
zio_checksum.h
zio_compress.h
zio_crypt.h Encryption Stability and On-Disk Format Fixes 2018-02-02 11:37:16 -08:00
zio_impl.h Native Encryption for ZFS on Linux 2017-08-14 10:36:48 -07:00
zio_priority.h
zio.h Extend deadman logic 2018-01-25 13:40:38 -08:00
zpl.h
zrlock.h
zvol.h Add port of FreeBSD 'volmode' property 2017-07-12 13:05:37 -07:00