diff options
author | Ricardo M. Correia <[email protected]> | 2010-08-26 10:17:18 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2010-08-31 08:38:44 -0700 |
commit | 090ff0929ec7a2e2e65efaaddb9981d15964f7d9 (patch) | |
tree | 25ab0cc3af03704344eb6ae0341e686dc750c39d /module | |
parent | a6098088eb706f643a726f71f22ea7126fcd822e (diff) |
Fix commit callbacks
The upstream commit cb code had a few bugs:
1) The arguments of the list_move_tail() call in txg_dispatch_callbacks()
were reversed by mistake. This caused the commit callbacks to not be
called at all.
2) ztest had a bug in ztest_dmu_commit_callbacks() where "error" was not
initialized correctly. This seems to have caused the test to always take
the simulated error code path, which made ztest unable to detect whether
commit cbs were being called for transactions that successfuly complete.
3) ztest had another bug in ztest_dmu_commit_callbacks() where the commit
cb threshold was not being compared correctly.
4) The commit cb taskq was using 'max_ncpus * 2' as the maxalloc argument
of taskq_create(), which could have caused unnecessary delays in the txg
sync thread.
Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'module')
-rw-r--r-- | module/zfs/txg.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/module/zfs/txg.c b/module/zfs/txg.c index 9b308ca4e..f9f24dd0a 100644 --- a/module/zfs/txg.c +++ b/module/zfs/txg.c @@ -335,15 +335,15 @@ txg_dispatch_callbacks(dsl_pool_t *dp, uint64_t txg) * Commit callback taskq hasn't been created yet. */ tx->tx_commit_cb_taskq = taskq_create("tx_commit_cb", - max_ncpus, minclsyspri, max_ncpus, max_ncpus * 2, - TASKQ_PREPOPULATE); + 100, minclsyspri, max_ncpus, INT_MAX, + TASKQ_THREADS_CPU_PCT | TASKQ_PREPOPULATE); } cb_list = kmem_alloc(sizeof (list_t), KM_SLEEP); list_create(cb_list, sizeof (dmu_tx_callback_t), offsetof(dmu_tx_callback_t, dcb_node)); - list_move_tail(&tc->tc_callbacks[g], cb_list); + list_move_tail(cb_list, &tc->tc_callbacks[g]); (void) taskq_dispatch(tx->tx_commit_cb_taskq, (task_func_t *) txg_do_callbacks, cb_list, TQ_SLEEP); |