diff --git a/storage/innobase/include/ib0mutex.h b/storage/innobase/include/ib0mutex.h index 7eeae16..ec55efd 100644 --- a/storage/innobase/include/ib0mutex.h +++ b/storage/innobase/include/ib0mutex.h @@ -332,7 +332,8 @@ struct TTASFutexMutex { } } - ut_delay(ut_rnd_interval(0, max_delay)); + ut_delay(max_delay); + } return (trylock()); @@ -455,8 +456,7 @@ struct TTASMutex { do { while (is_locked()) { - ut_delay(ut_rnd_interval(0, max_delay)); - + ut_delay(max_delay); ++i; if (i >= max_spins) { @@ -615,8 +615,7 @@ struct TTASEventMutex { if (!is_locked()) { return (true); } - - ut_delay(ut_rnd_interval(0, max_delay)); + ut_delay(max_delay); ++n_spins; diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index 20e5734..02539f0 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -6420,8 +6420,7 @@ void lock_trx_release_locks(trx_t *trx) /*!< in/out: transaction */ /** Doing an implicit to explicit conversion should not be expensive. */ - ut_delay(ut_rnd_interval(0, srv_spin_wait_delay)); - + ut_delay(srv_spin_wait_delay); trx_mutex_enter(trx); } diff --git a/storage/innobase/sync/sync0rw.cc b/storage/innobase/sync/sync0rw.cc index 039deda..f691e32 100644 --- a/storage/innobase/sync/sync0rw.cc +++ b/storage/innobase/sync/sync0rw.cc @@ -327,10 +327,8 @@ lock_loop: /* Spin waiting for the writer field to become free */ os_rmb; while (i < srv_n_spin_wait_rounds && lock->lock_word <= 0) { - if (srv_spin_wait_delay) { - ut_delay(ut_rnd_interval(0, srv_spin_wait_delay)); - } + ut_delay(srv_spin_wait_delay); i++; } @@ -434,10 +432,8 @@ void rw_lock_x_lock_wait_func( ut_ad(lock->lock_word <= threshold); while (lock->lock_word < threshold) { - if (srv_spin_wait_delay) { - ut_delay(ut_rnd_interval(0, srv_spin_wait_delay)); - } + ut_delay(srv_spin_wait_delay); if (i < srv_n_spin_wait_rounds) { i++; os_rmb; @@ -681,10 +677,8 @@ lock_loop: /* Spin waiting for the lock_word to become free */ os_rmb; while (i < srv_n_spin_wait_rounds && lock->lock_word <= X_LOCK_HALF_DECR) { - if (srv_spin_wait_delay) { - ut_delay(ut_rnd_interval(0, srv_spin_wait_delay)); - } - + ut_delay(srv_spin_wait_delay); + i++; } @@ -775,10 +769,8 @@ lock_loop: /* Spin waiting for the lock_word to become free */ os_rmb; while (i < srv_n_spin_wait_rounds && lock->lock_word <= X_LOCK_HALF_DECR) { - if (srv_spin_wait_delay) { - ut_delay(ut_rnd_interval(0, srv_spin_wait_delay)); - } + ut_delay(srv_spin_wait_delay); i++; }