Details
-
Bug
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
-
10.5
Description
MDEV-15053 reduced some buf_pool.mutex contention, shifting some contention to the buf_pool.page_hash latches.
MDEV-22850 removed some genuine contention on the latches by reducing the X-latch hold time.
But, based on earlier perf record analysis we seem to have some spurious contention on concurrent S-latch requests. I believe that this is due to the spin loop rw_lock_lock_word_decr() that rw_lock_s_lock() is executing.
Spurious S-latch conflicts could be addressed by implementing a bare-bones variant of rw-locks using std::atomic::fetch_add() for the S-latch and compare_exchange_strong() for the X-latch acquisition. This variant would not need to support any recursive latches at all.
As far as I understand, only dict_index_t::lock, buf_block_t::lock, fil_space_t::latch, dict_sys.latch, purge_sys.latch may truly require some additional ‘bells and whistles’, such as recursive X-locks or SX-locks, instrumentation, and event-based wakeup of waiting requests.
Most other types of InnoDB rw-locks should be held for extremely short durations only, and we might best implement both S and X latch acquisition with simple spin loops (inlined atomic operation possibly followed by a subroutine call for the spin loop).
Attachments
Issue Links
- blocks
-
MDEV-19929 Add a startup message about PAUSE instruction timing
- In Review
-
MDEV-21452 Use condition variables and normal mutexes instead of InnoDB os_event and mutex
- Closed
- causes
-
MDEV-23070 Duplicated counting of MONITOR_ADAPTIVE_HASH_ROW_ADDED
- Closed
-
MDEV-23369 False sharing in page_hash_latch::read_lock_wait()
- Closed
-
MDEV-23998 Race condition between buf_page_optimistic_get() and buf_page_t::init()
- Closed
-
MDEV-24271 rw_lock::read_lock_yield() may cause writer starvation
- Closed
-
MDEV-25815 mariabackup crash or debug assert with --backup --databases-exclude
- Closed
-
MDEV-26033 Race condition between buf_pool.page_hash and buffer pool resizing
- Closed
-
MDEV-26828 Spinning on buf_pool.page_hash is wasting CPU cycles
- Closed
- is blocked by
-
MDEV-22877 Avoid unnecessary buf_pool.page_hash S-latch acquisition
- Closed
- relates to
-
MDEV-24090 Optimize buf_page_optimistic_get()
- Open
-
MDEV-26609 Avoid deriving ELEMENT_PER_LATCH from cacheline
- Closed
-
MDEV-26826 Duplicated computations of buf_pool.page_hash addresses
- Closed
-
MDEV-14659 Innodb scalibility issue found in Mariadb code for complex 'select' queries in Arm platform
- Closed
-
MDEV-15053 Reduce buf_pool_t::mutex contention
- Closed
-
MDEV-22850 Reduce buf_pool.page_hash latch contention
- Closed