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/zil.h
          +++ new/usr/src/uts/common/fs/zfs/sys/zil.h
↓ open down ↓ 24 lines elided ↑ open up ↑
  25   25  
  26   26  /* Portions Copyright 2010 Robert Milkowski */
  27   27  
  28   28  #ifndef _SYS_ZIL_H
  29   29  #define _SYS_ZIL_H
  30   30  
  31   31  #include <sys/types.h>
  32   32  #include <sys/spa.h>
  33   33  #include <sys/zio.h>
  34   34  #include <sys/dmu.h>
       35 +#include <sys/dsl_pool.h>
       36 +#include <sys/dsl_dataset.h>
  35   37  
  36   38  #ifdef  __cplusplus
  37   39  extern "C" {
  38   40  #endif
  39   41  
  40   42  /*
  41   43   * Intent log format:
  42   44   *
  43   45   * Each objset has its own intent log.  The log header (zil_header_t)
  44   46   * for objset N's intent log is kept in the Nth object of the SPA's
↓ open down ↓ 353 lines elided ↑ open up ↑
 398  400  extern void     zil_destroy_sync(zilog_t *zilog, dmu_tx_t *tx);
 399  401  extern void     zil_rollback_destroy(zilog_t *zilog, dmu_tx_t *tx);
 400  402  
 401  403  extern itx_t    *zil_itx_create(uint64_t txtype, size_t lrsize);
 402  404  extern void     zil_itx_destroy(itx_t *itx);
 403  405  extern void     zil_itx_assign(zilog_t *zilog, itx_t *itx, dmu_tx_t *tx);
 404  406  
 405  407  extern void     zil_commit(zilog_t *zilog, uint64_t oid);
 406  408  
 407  409  extern int      zil_vdev_offline(const char *osname, void *txarg);
 408      -extern int      zil_claim(const char *osname, void *txarg);
 409      -extern int      zil_check_log_chain(const char *osname, void *txarg);
      410 +extern int      zil_claim(dsl_pool_t *dp, dsl_dataset_t *ds, void *txarg);
      411 +extern int      zil_check_log_chain(dsl_pool_t *dp, dsl_dataset_t *ds,
      412 +    void *tx);
 410  413  extern void     zil_sync(zilog_t *zilog, dmu_tx_t *tx);
 411  414  extern void     zil_clean(zilog_t *zilog, uint64_t synced_txg);
 412  415  
 413  416  extern int      zil_suspend(const char *osname, void **cookiep);
 414  417  extern void     zil_resume(void *cookie);
 415  418  
 416  419  extern void     zil_add_block(zilog_t *zilog, const blkptr_t *bp);
 417  420  extern int      zil_bp_tree_add(zilog_t *zilog, const blkptr_t *bp);
 418  421  
 419  422  extern void     zil_set_sync(zilog_t *zilog, uint64_t syncval);
 420  423  
 421  424  extern void     zil_set_logbias(zilog_t *zilog, uint64_t slogval);
 422  425  
 423  426  extern int zil_replay_disable;
 424  427  
 425  428  #ifdef  __cplusplus
 426  429  }
 427  430  #endif
 428  431  
 429  432  #endif  /* _SYS_ZIL_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX