freebsd-dev/module/zfs
George Melikov 1149ba6478 OpenZFS 7606 - dmu_objset_find_dp() takes a long time while importing pool
When importing a pool with a large number of filesystems within the same
parent filesystem, we see that dmu_objset_find_dp() takes a long time.
It is called from 3 places: spa_check_logs(), spa_ld_claim_log_blocks(),
and spa_load_verify().

There are several ways to improve performance here:

    1. We don't really need to do spa_check_logs() or
       spa_ld_claim_log_blocks() if the pool was closed cleanly.

    2. spa_load_verify() uses dmu_objset_find_dp() to check that no
       datasets have too long of names.

    3. dmu_objset_find_dp() is slow because it's doing
       zap_value_search() (which is O(N sibling datasets)) to determine
       the name of each dsl_dir when it's opened. In this case we
       actually know the name when we are opening it, so we can provide
       it and avoid the lookup.

This change implements fix #3 from the above list; i.e. make
dmu_objset_find_dp() provide the name of the dataset so that we don't
have to search for it.

Authored by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prashanth Sreenivasa <prashksp@gmail.com>
Reviewed-by: David Quigley <david.quigley@intel.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: George Melikov <mail@gmelikov.ru>

OpenZFS-issue: https://www.illumos.org/issues/7606
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/cac6bab
Closes #5662
2017-01-26 12:46:02 -08:00
..
abd.c codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
arc.c codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
blkptr.c DLPX-44812 integrate EP-220 large memory scalability 2016-11-29 14:34:27 -08:00
bplist.c Change KM_PUSHPAGE -> KM_SLEEP 2015-01-16 14:41:26 -08:00
bpobj.c Illumos 5810 - zdb should print details of bpobj 2015-05-11 15:10:24 -07:00
bptree.c OpenZFS 7082 - bptree_iterate() passes wrong args to zfs_dbgmsg() 2017-01-17 14:49:24 -08:00
bqueue.c Fix coverity defects: CID 147565-147567 2016-10-07 13:19:43 -07:00
dbuf_stats.c OpenZFS 6950 - ARC should cache compressed data 2016-09-13 09:58:33 -07:00
dbuf.c codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
ddt_zap.c Change KM_PUSHPAGE -> KM_SLEEP 2015-01-16 14:41:26 -08:00
ddt.c Cache ddt_get_dedup_dspace() value if there was no ddt changes 2016-12-02 16:59:35 -07:00
dmu_diff.c OpenZFS 6950 - ARC should cache compressed data 2016-09-13 09:58:33 -07:00
dmu_object.c Fix unallocated object detection for large_dnode datasets 2017-01-13 15:47:34 -08:00
dmu_objset.c OpenZFS 7606 - dmu_objset_find_dp() takes a long time while importing pool 2017-01-26 12:46:02 -08:00
dmu_send.c codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
dmu_traverse.c Add TASKQID_INVALID 2016-11-02 12:14:45 -07:00
dmu_tx.c OpenZFS 7054 - dmu_tx_hold_t should use refcount_t to track space 2017-01-23 09:36:24 -08:00
dmu_zfetch.c Use cstyle -cpP in make cstyle check 2016-12-12 10:46:26 -08:00
dmu.c codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
dnode_sync.c Fix spelling 2017-01-03 11:31:18 -06:00
dnode.c Fix unallocated object detection for large_dnode datasets 2017-01-13 15:47:34 -08:00
dsl_bookmark.c OpenZFS 6314 - buffer overflow in dsl_dataset_name 2016-06-28 13:47:03 -07:00
dsl_dataset.c Suspend/resume zvol for recv and rollback 2017-01-19 13:56:36 -08:00
dsl_deadlist.c Performance optimization of AVL tree comparator functions 2016-08-31 14:35:34 -07:00
dsl_deleg.c Performance optimization of AVL tree comparator functions 2016-08-31 14:35:34 -07:00
dsl_destroy.c OpenZFS 2605, 6980, 6902 2016-06-28 13:47:02 -07:00
dsl_dir.c Fix coverity defects: 147658, 147652, 147651 2016-09-29 12:06:14 -07:00
dsl_pool.c Use cstyle -cpP in make cstyle check 2016-12-12 10:46:26 -08:00
dsl_prop.c Fix dsl_props_set_sync_impl to work with nested nvlist 2016-12-20 18:46:59 -08:00
dsl_scan.c Fix spelling 2017-01-03 11:31:18 -06:00
dsl_synctask.c Illumos 4951 - ZFS administrative commands should use reserved space 2015-05-04 09:41:10 -07:00
dsl_userhold.c OpenZFS 6314 - buffer overflow in dsl_dataset_name 2016-06-28 13:47:03 -07:00
edonr_zfs.c DLPX-44812 integrate EP-220 large memory scalability 2016-11-29 14:34:27 -08:00
fm.c Use cstyle -cpP in make cstyle check 2016-12-12 10:46:26 -08:00
gzip.c Use cstyle -cpP in make cstyle check 2016-12-12 10:46:26 -08:00
lz4.c Fix spelling 2017-01-03 11:31:18 -06:00
lzjb.c Change KM_PUSHPAGE -> KM_SLEEP 2015-01-16 14:41:26 -08:00
Makefile.in DLPX-44812 integrate EP-220 large memory scalability 2016-11-29 14:34:27 -08:00
metaslab.c OpenZFS 7303 - dynamic metaslab selection 2017-01-12 11:52:56 -08:00
multilist.c Identify locks flagged by lockdep 2015-12-22 10:21:33 -08:00
pathname.c Add pn_alloc()/pn_free() functions 2016-04-21 09:49:25 -07:00
policy.c codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
range_tree.c Performance optimization of AVL tree comparator functions 2016-08-31 14:35:34 -07:00
refcount.c OpenZFS 7090 - zfs should throttle allocations 2016-10-13 17:59:18 -07:00
rrwlock.c Fix spelling 2017-01-03 11:31:18 -06:00
sa.c OpenZFS 6529 - Properly handle updates of variably-sized SA entries 2017-01-19 13:50:22 -08:00
sha256.c DLPX-44812 integrate EP-220 large memory scalability 2016-11-29 14:34:27 -08:00
skein_zfs.c DLPX-44812 integrate EP-220 large memory scalability 2016-11-29 14:34:27 -08:00
spa_boot.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
spa_config.c Fix spelling 2017-01-03 11:31:18 -06:00
spa_errlog.c Illumos 4914 - zfs on-disk bookmark structure should be named *_phys_t 2014-08-06 14:48:41 -07:00
spa_history.c Fix indefinite article 2016-08-11 11:23:49 -07:00
spa_misc.c codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
spa_stats.c Fix spelling 2017-01-03 11:31:18 -06:00
spa.c OpenZFS 7743 - per-vdev-zaps init path for upgrade 2017-01-13 13:50:22 -08:00
space_map.c OpenZFS 7303 - dynamic metaslab selection 2017-01-12 11:52:56 -08:00
space_reftree.c OpenZFS 6328 - Fix cstyle errors in zfs codebase 2017-01-12 09:42:11 -08:00
trace.c OpenZFS 6531 - Provide mechanism to artificially limit disk performance 2016-05-26 10:11:51 -07:00
txg.c Refactor txg history kstat 2016-12-02 16:57:49 -07:00
uberblock.c Illumos 5347 - idle pool may run itself out of space 2015-07-14 10:35:21 -07:00
unique.c Performance optimization of AVL tree comparator functions 2016-08-31 14:35:34 -07:00
vdev_cache.c DLPX-44812 integrate EP-220 large memory scalability 2016-11-29 14:34:27 -08:00
vdev_disk.c 4.10 compat - BIO flag changes and others 2016-12-30 16:03:59 -06:00
vdev_file.c Use a dedicated taskq for vdev_file 2016-12-21 10:47:15 -08:00
vdev_label.c OpenZFS 6328 - Fix cstyle errors in zfs codebase 2017-01-12 09:42:11 -08:00
vdev_mirror.c codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
vdev_missing.c Illumos #5244 - zio pipeline callers should explicitly invoke next stage 2015-04-30 15:07:47 -07:00
vdev_queue.c Use cstyle -cpP in make cstyle check 2016-12-12 10:46:26 -08:00
vdev_raidz_math_aarch64_neon_common.h ABD raidz NEON support 2016-11-29 14:34:33 -08:00
vdev_raidz_math_aarch64_neon.c codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
vdev_raidz_math_aarch64_neonx2.c ABD raidz NEON support 2016-11-29 14:34:33 -08:00
vdev_raidz_math_avx2.c ABD raidz avx512f support 2016-11-29 14:34:33 -08:00
vdev_raidz_math_avx512bw.c ABD: Adapt avx512bw raidz assembly 2016-12-15 17:31:33 -08:00
vdev_raidz_math_avx512f.c Use cstyle -cpP in make cstyle check 2016-12-12 10:46:26 -08:00
vdev_raidz_math_impl.h codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
vdev_raidz_math_scalar.c ABD Vectorized raidz 2016-11-29 14:34:33 -08:00
vdev_raidz_math_sse2.c ABD raidz avx512f support 2016-11-29 14:34:33 -08:00
vdev_raidz_math_ssse3.c codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
vdev_raidz_math.c codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
vdev_raidz.c ABD changes for vectorized RAIDZ 2016-11-29 14:34:33 -08:00
vdev_root.c Illumos #3598 2013-10-31 14:58:04 -07:00
vdev.c codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
zap_leaf.c OpenZFS 6328 - Fix cstyle errors in zfs codebase 2017-01-12 09:42:11 -08:00
zap_micro.c OpenZFS 7054 - dmu_tx_hold_t should use refcount_t to track space 2017-01-23 09:36:24 -08:00
zap.c OpenZFS 7054 - dmu_tx_hold_t should use refcount_t to track space 2017-01-23 09:36:24 -08:00
zfeature_common.c OpenZFS 6586 - Whitespace inconsistencies in the spa feature dependency arrays in zfeature_common.c 2017-01-17 14:46:28 -08:00
zfeature.c OpenZFS 6328 - Fix cstyle errors in zfs codebase 2017-01-12 09:42:11 -08:00
zfs_acl.c Fix unlinked file cannot do xattr operations 2016-11-04 10:46:40 -07:00
zfs_byteswap.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
zfs_ctldir.c codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
zfs_debug.c Use cstyle -cpP in make cstyle check 2016-12-12 10:46:26 -08:00
zfs_dir.c OpenZFS 6328 - Fix cstyle errors in zfs codebase 2017-01-12 09:42:11 -08:00
zfs_fm.c Fix coverity defects: CID 147626, 147628 2016-11-08 14:28:17 -08:00
zfs_fuid.c Fix coverity defects 2016-09-21 18:09:00 -07:00
zfs_ioctl.c OpenZFS 7180 - potential race between zfs_suspend_fs+zfs_resume_fs and zfs_ioc_rename 2017-01-23 10:53:46 -08:00
zfs_log.c OpenZFS 6328 - Fix cstyle errors in zfs codebase 2017-01-12 09:42:11 -08:00
zfs_onexit.c zfsdev_getminor() should check for invalid file handles 2015-06-22 17:02:13 -07:00
zfs_replay.c OpenZFS 6328 - Fix cstyle errors in zfs codebase 2017-01-12 09:42:11 -08:00
zfs_rlock.c Fix spelling 2017-01-03 11:31:18 -06:00
zfs_sa.c Convert zio_buf_alloc() consumers 2016-11-30 16:18:20 -07:00
zfs_vfsops.c OpenZFS 7180 - potential race between zfs_suspend_fs+zfs_resume_fs and zfs_ioc_rename 2017-01-23 10:53:46 -08:00
zfs_vnops.c OpenZFS 7256 - low probability race in zfs_get_data 2017-01-17 15:18:59 -08:00
zfs_znode.c Use inode_set_flags when available 2016-12-16 13:54:51 -08:00
zil.c Fix spelling 2017-01-03 11:31:18 -06:00
zio_checksum.c codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
zio_compress.c DLPX-44812 integrate EP-220 large memory scalability 2016-11-29 14:34:27 -08:00
zio_inject.c Compile zio.h and zio_impl.h mutual include 2016-12-01 16:36:25 -07:00
zio.c codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
zle.c Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
zpl_ctldir.c Linux 4.9 compat: iops->rename() wants flags 2016-10-20 09:39:09 -07:00
zpl_export.c Use cstyle -cpP in make cstyle check 2016-12-12 10:46:26 -08:00
zpl_file.c codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
zpl_inode.c 4.10 compat - BIO flag changes and others 2016-12-30 16:03:59 -06:00
zpl_super.c Fix memleak in zpl_parse_options 2016-05-31 16:04:26 -07:00
zpl_xattr.c Fix spelling 2017-01-03 11:31:18 -06:00
zrlock.c OpenZFS 3746 - ZRLs are racy 2017-01-23 10:35:58 -08:00
zvol.c codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00