diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-10-27 17:21:19 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-10-27 17:21:19 +0300 |
commit | 1ad1d789815ddada89d8fb557a47a437d1ea21c2 (patch) | |
tree | 9ae16c031d5a04d1be229d810eaf2dd720c16bf3 | |
parent | 83dbf2c99525f4e9bfc313609194c3e4f23292a4 (diff) | |
download | mariadb-git-1ad1d789815ddada89d8fb557a47a437d1ea21c2.tar.gz |
MDEV-26779: Enable adaptive spinning on ARMv8 for lock_sys.wait_mutex
Similar to commit f7684f0ca5f6f53d63e93afe89194b43bb5431d2 (MDEV-26855)
we will try to enable the adaptive spinloop for lock_sys.wait_mutex
on ARMv8.
Enabling any form of spinloop for lock_sys.wait_mutex did not show a
significant improvement in our tests on AMD64.
Spinning can be argued to be a hack to reduce the impact on mutex
contention. It would be better to adjust the code to reduce
contention in the first place.
-rw-r--r-- | storage/innobase/lock/lock0lock.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index f088d0186bd..850c13ccf9c 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -391,7 +391,11 @@ void lock_sys_t::create(ulint n_cells) m_initialised= true; latch.SRW_LOCK_INIT(lock_latch_key); +#ifdef __aarch64__ + mysql_mutex_init(lock_wait_mutex_key, &wait_mutex, MY_MUTEX_INIT_FAST); +#else mysql_mutex_init(lock_wait_mutex_key, &wait_mutex, nullptr); +#endif #ifdef SUX_LOCK_GENERIC pthread_mutex_init(&hash_mutex, nullptr); pthread_cond_init(&hash_cond, nullptr); |