diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2017-11-30 18:07:28 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2017-11-30 18:07:28 +0400 |
commit | e01d788428270d2039f1e9adf637fbd185ee91a0 (patch) | |
tree | 3b4362da15e54fc4ea16ef26fbfaa7dcb8e42e52 | |
parent | 7cb3520c0632ad912b309489ad86a90f9fc9bd0b (diff) | |
download | mariadb-git-e01d788428270d2039f1e9adf637fbd185ee91a0.tar.gz |
Optimized away excessive condition
trx_set_rw_mode() is never called for read-only transactions, this is guarded
by callers.
Removing this condition from critical section immediately gives 5% scalability
improvement in OLTP index updates benchmark.
-rw-r--r-- | storage/innobase/trx/trx0trx.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index edf2e295387..6792eb9c982 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -3039,6 +3039,7 @@ trx_set_rw_mode( ut_ad(trx->rsegs.m_redo.rseg == 0); ut_ad(!trx->in_rw_trx_list); ut_ad(!trx_is_autocommit_non_locking(trx)); + ut_ad(!trx->read_only); if (high_level_read_only) { return; @@ -3075,11 +3076,9 @@ trx_set_rw_mode( } #endif /* UNIV_DEBUG */ - if (!trx->read_only) { - UT_LIST_ADD_FIRST(trx_sys->rw_trx_list, trx); + UT_LIST_ADD_FIRST(trx_sys->rw_trx_list, trx); - ut_d(trx->in_rw_trx_list = true); - } + ut_d(trx->in_rw_trx_list = true); mutex_exit(&trx_sys->mutex); } |