Print this page
NEX-4794 Write Back Cache sync and async writes: adjust routing according to watermark limits
Reviewed by: Alex Aizman <alex.aizman@nexenta.com>
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
5269 zpool import slow
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Dan McDonald <danmcd@omniti.com>

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 ↓ 345 lines elided ↑ open up ↑
 346  346  
 347  347  /*
 348  348   * Writes are handled in three different ways:
 349  349   *
 350  350   * WR_INDIRECT:
 351  351   *    In this mode, if we need to commit the write later, then the block
 352  352   *    is immediately written into the file system (using dmu_sync),
 353  353   *    and a pointer to the block is put into the log record.
 354  354   *    When the txg commits the block is linked in.
 355  355   *    This saves additionally writing the data into the log record.
 356      - *    There are a few requirements for this to occur:
 357      - *      - write is greater than zfs/zvol_immediate_write_sz
 358      - *      - not using slogs (as slogs are assumed to always be faster
 359      - *        than writing into the main pool)
 360      - *      - the write occupies only one block
      356 + *    There are a few requirements for this to occur. In general, WR_INDIRECT
      357 + *    with the subsequent dmu_sync-ing of the data directly into the filesystem
      358 + *    is used in the two following separate cases:
      359 + *      - logbias = THROUGHPUT mode
      360 + *      - writeback cache (via special vdev) when there is no separate slog
      361 + *    For specific details and configurable tunables - see zfs_log_write().
 361  362   * WR_COPIED:
 362  363   *    If we know we'll immediately be committing the
 363  364   *    transaction (FSYNC or FDSYNC), the we allocate a larger
 364  365   *    log record here for the data and copy the data in.
 365  366   * WR_NEED_COPY:
 366  367   *    Otherwise we don't allocate a buffer, and *if* we need to
 367  368   *    flush the write later then a buffer is allocated and
 368  369   *    we retrieve the data using the dmu.
 369  370   */
 370  371  typedef enum {
↓ open down ↓ 41 lines elided ↑ open up ↑
 412  413  extern void     zil_destroy_sync(zilog_t *zilog, dmu_tx_t *tx);
 413  414  extern void     zil_rollback_destroy(zilog_t *zilog, dmu_tx_t *tx);
 414  415  
 415  416  extern itx_t    *zil_itx_create(uint64_t txtype, size_t lrsize);
 416  417  extern void     zil_itx_destroy(itx_t *itx);
 417  418  extern void     zil_itx_assign(zilog_t *zilog, itx_t *itx, dmu_tx_t *tx);
 418  419  
 419  420  extern void     zil_commit(zilog_t *zilog, uint64_t oid);
 420  421  extern void     zil_commit_impl(zilog_t *zilog, uint64_t oid);
 421  422  
 422      -extern int      zil_reset(const char *osname, void *txarg);
      423 +extern int      zil_vdev_offline(const char *osname, void *txarg);
 423  424  extern int      zil_claim(struct dsl_pool *dp,
 424  425      struct dsl_dataset *ds, void *txarg);
 425  426  extern int      zil_check_log_chain(struct dsl_pool *dp,
 426  427      struct dsl_dataset *ds, void *tx);
 427  428  extern void     zil_sync(zilog_t *zilog, dmu_tx_t *tx);
 428  429  extern void     zil_clean(zilog_t *zilog, uint64_t synced_txg);
 429  430  
 430  431  extern int      zil_suspend(const char *osname, void **cookiep);
 431  432  extern void     zil_resume(void *cookie);
 432  433  
↓ open down ↓ 15 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX