Commit f7684f0c authored by Krunal Bauskar's avatar Krunal Bauskar Committed by Marko Mäkelä

MDEV-26855: Enable spinning for log_sys_mutex and log_flush_order_mutex

As part of MDEV-26779 we first discovered the effect of enabling spinning for
some critical mutex. MDEV-26779 tried enabling it for lock_sys.wait_mutex and
observed a good gain in performance.

In yet another discussion, Mark Callaghan pointed a reference to pthread based
mutex spin using PTHREAD_MUTEX_ADAPTIVE_NP (MDEV-26769 Intel RTM).

Given the strong references, Marko Makela as part of his comment in #1923
pointed an idea to enable spinning for other mutexes. Based on perf profiling
we decided to explore spinning for log_sys_mutex and log_flush_order_mutex as
they are occupying the top slots in the contented mutex list.

The evaluation showed promising results for ARM64 but not for x86.
So a patch is here-by proposed to enable the spinning of the mutex for
ARM64-based platform.
parent c3c53926
......@@ -175,8 +175,14 @@ void log_t::create()
ut_ad(!is_initialised());
m_initialised= true;
#if defined(__aarch64__)
mysql_mutex_init(log_sys_mutex_key, &mutex, MY_MUTEX_INIT_FAST);
mysql_mutex_init(
log_flush_order_mutex_key, &flush_order_mutex, MY_MUTEX_INIT_FAST);
#else
mysql_mutex_init(log_sys_mutex_key, &mutex, nullptr);
mysql_mutex_init(log_flush_order_mutex_key, &flush_order_mutex, nullptr);
#endif
/* Start the lsn from one log block from zero: this way every
log record has a non-zero start lsn, a fact which we will use */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment