Skip to content
Permalink
Browse files
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.
  • Loading branch information
Sergey Vojtovich committed Nov 30, 2017
1 parent 7cb3520 commit e01d788
Showing 1 changed file with 3 additions and 4 deletions.
@@ -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);
}

0 comments on commit e01d788

Please sign in to comment.