summaryrefslogtreecommitdiff
path: root/storage/innobase/include/trx0purge.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-09-06 12:32:24 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-09-06 12:32:24 +0300
commit277ba134ad1c994bda50de574a87a06a071fbecb (patch)
treed31a06a7a8c3c4fe116664ccf7c2f6c0273e67e0 /storage/innobase/include/trx0purge.h
parent0f0b7e47bc794d0af0b7f758a6fe1518b8388e3a (diff)
downloadmariadb-git-277ba134ad1c994bda50de574a87a06a071fbecb.tar.gz
MDEV-26467: Avoid futile spin loops
Typically, index_lock and fil_space_t::latch will be held for a longer time than the spin loop in latch acquisition would be waiting for. Let us avoid spin loops for those as well as dict_sys.latch, which could be held in exclusive mode for a longer time (while loading metadata into the buffer pool and the dictionary cache). Performance testing on a dual Intel Xeon E5-2630 v4 (2 NUMA nodes) suggests that the buffer pool page latch (block_lock) benefits from a spin loop in both read-only and read-write workloads where the working set is slightly larger than the buffer pool. Presumably, most contention would occur on leaf page latches. Contention on upper level pages in the buffer pool should intuitively last longer. We introduce srw_spin_lock and srw_spin_mutex to allow users of srw_lock or srw_mutex to opt in for the spin loop. On Microsoft Windows, a spin loop variant was and will not be available; srw_mutex and srw_lock will simply wrap SRWLOCK. That is, on Microsoft Windows, the parameters innodb_sync_spin_loops and innodb_spin_wait_delay will only affect block_lock.
Diffstat (limited to 'storage/innobase/include/trx0purge.h')
-rw-r--r--storage/innobase/include/trx0purge.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/storage/innobase/include/trx0purge.h b/storage/innobase/include/trx0purge.h
index c2c755e183a..417c6688e83 100644
--- a/storage/innobase/include/trx0purge.h
+++ b/storage/innobase/include/trx0purge.h
@@ -125,7 +125,7 @@ class purge_sys_t
{
public:
/** latch protecting view, m_enabled */
- MY_ALIGNED(CACHE_LINE_SIZE) mutable srw_lock latch;
+ MY_ALIGNED(CACHE_LINE_SIZE) mutable srw_spin_lock latch;
private:
/** The purge will not remove undo logs which are >= this view */
ReadViewBase view;