MDEV-39040 log_sys.latch performance lost to PERFORMANCE_SCHEMA#4784
MDEV-39040 log_sys.latch performance lost to PERFORMANCE_SCHEMA#4784
Conversation
|
|
iMineLink
left a comment
There was a problem hiding this comment.
Compilation is broken with WITH_INNODB_EXTRA_DEBUG=ON, otherwise changes look good.
Maybe a comment could be left in the code explaining the reason of using srw_lock_low for the log_sys.latch, to ease reading?
log_sys.latch: Remove the PERFORMANCE_SCHEMA instrumentation. We already know that this is a very busy latch. All code paths where a shared log_sys.latch is being held should already be highly optimized. The few paths where an exclusive log_sys.latch is being held are known to be potentially problematic, but rare. Removing the PERFORMANCE_SCHEMA instrumentation for this latch is expected to improve performance. On a quick Sysbench run with performance_schema_instrument=wait/synch/rwlock/%=on I observed an 2.9% improvement on throughput. srw_lock_debug_simple: A non-instrumented version of srw_lock_debug, to allow PERFORMANCE_SCHEMA to work WITH_INNODB_EXTRA_DEBUG=ON.
iMineLink
left a comment
There was a problem hiding this comment.
LGTM.
The new srw_lock_debug_simple implementation is closely tracking srw_lock_debug.
I suppose that code is "cold" enough (from a development perspective) that duplication is acceptable.
Build errors are fixed.
Did not do any performance testing though, but less runtime bloat on a hot latch can be useful anyway if the PFS instrumentation was not useful anyway, in my opinion. If there are known issues being diagnosed via PFS on this latch, I would be a bit more wary to merge this.
Description
log_sys.latch: Remove thePERFORMANCE_SCHEMAinstrumentation. We already know that this is a very busy latch. All code paths where a sharedlog_sys.latchis being held should already be highly optimized. The few paths where an exclusivelog_sys.latchis being held are known to be potentially problematic, but rare.Release Notes
The
PERFORMANCE_SCHEMAinstrumentwait/synch/rwlock/innodb/log_latchwas removed.How can this PR be tested?
On a quick Sysbench
oltp_update_indexrun withI observed an 2.9% improvement on throughput. It could be more in other test scenarios.
Basing the PR against the correct MariaDB version
mainbranch.PR quality check