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/vdev.h
          +++ new/usr/src/uts/common/fs/zfs/sys/vdev.h
↓ open down ↓ 52 lines elided ↑ open up ↑
  53   53  extern int vdev_validate(vdev_t *, boolean_t);
  54   54  extern void vdev_close(vdev_t *);
  55   55  extern int vdev_create(vdev_t *, uint64_t txg, boolean_t isreplace);
  56   56  extern void vdev_reopen(vdev_t *);
  57   57  extern int vdev_validate_aux(vdev_t *vd);
  58   58  extern zio_t *vdev_probe(vdev_t *vd, zio_t *pio);
  59   59  
  60   60  extern boolean_t vdev_is_bootable(vdev_t *vd);
  61   61  extern vdev_t *vdev_lookup_top(spa_t *spa, uint64_t vdev);
  62   62  extern vdev_t *vdev_lookup_by_guid(vdev_t *vd, uint64_t guid);
       63 +extern int vdev_count_leaves(spa_t *spa);
  63   64  extern void vdev_dtl_dirty(vdev_t *vd, vdev_dtl_type_t d,
  64   65      uint64_t txg, uint64_t size);
  65   66  extern boolean_t vdev_dtl_contains(vdev_t *vd, vdev_dtl_type_t d,
  66   67      uint64_t txg, uint64_t size);
  67   68  extern boolean_t vdev_dtl_empty(vdev_t *vd, vdev_dtl_type_t d);
  68   69  extern void vdev_dtl_reassess(vdev_t *vd, uint64_t txg, uint64_t scrub_txg,
  69   70      int scrub_done);
  70   71  extern boolean_t vdev_dtl_required(vdev_t *vd);
  71   72  extern boolean_t vdev_resilver_needed(vdev_t *vd,
  72   73      uint64_t *minp, uint64_t *maxp);
↓ open down ↓ 92 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX