Print this page
5269 zfs: zpool import slow
While importing a pool all objsets are enumerated twice, once to check
the zil log chains and once to claim them. On pools with many datasets
this process might take a substantial amount of time.
Speed up the process by parallelizing it utilizing a taskq. The number
of parallel tasks is limited to 4 times the number of leaf vdevs.

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/sys/dmu_objset.h
          +++ new/usr/src/uts/common/fs/zfs/sys/dmu_objset.h
↓ open down ↓ 129 lines elided ↑ open up ↑
 130  130  #define DMU_OS_IS_L2CACHEABLE(os)                               \
 131  131          ((os)->os_secondary_cache == ZFS_CACHE_ALL ||           \
 132  132          (os)->os_secondary_cache == ZFS_CACHE_METADATA)
 133  133  
 134  134  #define DMU_OS_IS_L2COMPRESSIBLE(os)    (zfs_mdcomp_disable == B_FALSE)
 135  135  
 136  136  /* called from zpl */
 137  137  int dmu_objset_hold(const char *name, void *tag, objset_t **osp);
 138  138  int dmu_objset_own(const char *name, dmu_objset_type_t type,
 139  139      boolean_t readonly, void *tag, objset_t **osp);
      140 +int dmu_objset_own_obj(dsl_pool_t *dp, uint64_t obj, dmu_objset_type_t type,
      141 +    boolean_t readonly, void *tag, objset_t **osp);
 140  142  void dmu_objset_refresh_ownership(objset_t *os, void *tag);
 141  143  void dmu_objset_rele(objset_t *os, void *tag);
 142  144  void dmu_objset_disown(objset_t *os, void *tag);
 143  145  int dmu_objset_from_ds(struct dsl_dataset *ds, objset_t **osp);
 144  146  
 145  147  void dmu_objset_stats(objset_t *os, nvlist_t *nv);
 146  148  void dmu_objset_fast_stat(objset_t *os, dmu_objset_stats_t *stat);
 147  149  void dmu_objset_space(objset_t *os, uint64_t *refdbytesp, uint64_t *availbytesp,
 148  150      uint64_t *usedobjsp, uint64_t *availobjsp);
 149  151  uint64_t dmu_objset_fsid_guid(objset_t *os);
↓ open down ↓ 30 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX