#include <sys/sa_impl.h>
#include <sys/zfs_context.h>
#include <sys/varargs.h>
+#include <sys/trace_dmu.h>
typedef void (*dmu_tx_hold_func_t)(dmu_tx_t *tx, struct dnode *dn,
uint64_t arg1, uint64_t arg2);
{ "dmu_tx_error", KSTAT_DATA_UINT64 },
{ "dmu_tx_suspended", KSTAT_DATA_UINT64 },
{ "dmu_tx_group", KSTAT_DATA_UINT64 },
- { "dmu_tx_how", KSTAT_DATA_UINT64 },
{ "dmu_tx_memory_reserve", KSTAT_DATA_UINT64 },
{ "dmu_tx_memory_reclaim", KSTAT_DATA_UINT64 },
- { "dmu_tx_memory_inflight", KSTAT_DATA_UINT64 },
{ "dmu_tx_dirty_throttle", KSTAT_DATA_UINT64 },
{ "dmu_tx_dirty_delay", KSTAT_DATA_UINT64 },
{ "dmu_tx_dirty_over_max", KSTAT_DATA_UINT64 },
dmu_tx_t *
dmu_tx_create_dd(dsl_dir_t *dd)
{
- dmu_tx_t *tx = kmem_zalloc(sizeof (dmu_tx_t), KM_PUSHPAGE);
+ dmu_tx_t *tx = kmem_zalloc(sizeof (dmu_tx_t), KM_SLEEP);
tx->tx_dir = dd;
if (dd != NULL)
tx->tx_pool = dd->dd_pool;
}
}
- txh = kmem_zalloc(sizeof (dmu_tx_hold_t), KM_PUSHPAGE);
+ txh = kmem_zalloc(sizeof (dmu_tx_hold_t), KM_SLEEP);
txh->txh_tx = tx;
txh->txh_dnode = dn;
#ifdef DEBUG_DMU_TX
dmu_tx_hold_t *txh;
ASSERT(tx->tx_txg == 0);
- ASSERT(len < DMU_MAX_ACCESS);
+ ASSERT(len <= DMU_MAX_ACCESS);
ASSERT(len == 0 || UINT64_MAX - off >= len - 1);
txh = dmu_tx_hold_object_impl(tx, tx->tx_objset,
match_object = TRUE;
break;
default:
- ASSERT(!"bad txh_type");
+ cmn_err(CE_PANIC, "bad txh_type %d",
+ txh->txh_type);
}
}
if (match_object && match_offset) {
int
dmu_tx_assign(dmu_tx_t *tx, txg_how_t txg_how)
{
- hrtime_t before;
int err;
ASSERT(tx->tx_txg == 0);
txg_how == TXG_WAITED);
ASSERT(!dsl_pool_sync_context(tx->tx_pool));
- before = gethrtime();
-
if (txg_how == TXG_WAITED)
tx->tx_waited = B_TRUE;
txg_rele_to_quiesce(&tx->tx_txgh);
- spa_tx_assign_add_nsecs(tx->tx_pool->dp_spa, gethrtime() - before);
-
return (0);
}
{
spa_t *spa = tx->tx_pool->dp_spa;
dsl_pool_t *dp = tx->tx_pool;
+ hrtime_t before;
ASSERT(tx->tx_txg == 0);
ASSERT(!dsl_pool_config_held(tx->tx_pool));
+ before = gethrtime();
+
if (tx->tx_wait_dirty) {
uint64_t dirty;
*/
txg_wait_open(tx->tx_pool, tx->tx_lasttried_txg + 1);
}
+
+ spa_tx_assign_add_nsecs(spa, gethrtime() - before);
}
void
{
dmu_tx_callback_t *dcb;
- dcb = kmem_alloc(sizeof (dmu_tx_callback_t), KM_PUSHPAGE);
+ dcb = kmem_alloc(sizeof (dmu_tx_callback_t), KM_SLEEP);
dcb->dcb_func = func;
dcb->dcb_data = data;