Print this page
NEX-20218 Backport Illumos #9474 txg_kick() fails to see that we are quiescing, forcing transactions to their next stages without leaving them accumulate changes
MFV illumos-gate@fa41d87de9ec9000964c605eb01d6dc19e4a1abe
    9464 txg_kick() fails to see that we are quiescing, forcing transactions to their next stages without leaving them accumulate changes
    Reviewed by: Matt Ahrens <matt@delphix.com>
    Reviewed by: Brad Lewis <brad.lewis@delphix.com>
    Reviewed by: Andriy Gapon <avg@FreeBSD.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/sys/txg_impl.h
          +++ new/usr/src/uts/common/fs/zfs/sys/txg_impl.h
↓ open down ↓ 17 lines elided ↑ open up ↑
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27   27  /*
  28      - * Copyright (c) 2013 by Delphix. All rights reserved.
       28 + * Copyright (c) 2013, 2017 by Delphix. All rights reserved.
  29   29   */
  30   30  
  31   31  #ifndef _SYS_TXG_IMPL_H
  32   32  #define _SYS_TXG_IMPL_H
  33   33  
  34   34  #include <sys/spa.h>
  35   35  #include <sys/txg.h>
  36   36  
  37   37  #ifdef  __cplusplus
  38   38  extern "C" {
↓ open down ↓ 46 lines elided ↑ open up ↑
  85   85   * protect the tx_open_txg. Instead a special lock in the tx_cpu structure
  86   86   * is used. Readers of tx_open_txg must grab the per-cpu tc_open_lock.
  87   87   * Any thread wishing to update tx_open_txg must grab the tc_open_lock on
  88   88   * every cpu (see txg_quiesce()).
  89   89   */
  90   90  typedef struct tx_state {
  91   91          tx_cpu_t        *tx_cpu;        /* protects access to tx_open_txg */
  92   92          kmutex_t        tx_sync_lock;   /* protects the rest of this struct */
  93   93  
  94   94          uint64_t        tx_open_txg;    /* currently open txg id */
       95 +        uint64_t        tx_quiescing_txg; /* currently quiescing txg id */
  95   96          uint64_t        tx_quiesced_txg; /* quiesced txg waiting for sync */
  96   97          uint64_t        tx_syncing_txg; /* currently syncing txg id */
  97   98          uint64_t        tx_synced_txg;  /* last synced txg id */
  98   99  
  99  100          hrtime_t        tx_open_time;   /* start time of tx_open_txg */
 100  101  
 101  102          uint64_t        tx_sync_txg_waiting; /* txg we're waiting to sync */
 102  103          uint64_t        tx_quiesce_txg_waiting; /* txg we're waiting to open */
 103  104  
 104  105          kcondvar_t      tx_sync_more_cv;
↓ open down ↓ 20 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX