[MDEV-27935] Enable performance_schema profiling for trx_rseg_t latch Created: 2022-02-24  Updated: 2022-03-14  Resolved: 2022-02-24

Status: Closed
Project: MariaDB Server
Component/s: Performance Schema, Storage Engine - InnoDB
Affects Version/s: 10.6.3, 10.6
Fix Version/s: 10.6.8, 10.7.4, 10.8.3

Type: Bug Priority: Minor
Reporter: Krunal Bauskar Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: None

Attachments: PNG File baseline vs patched (so adding pfs support for rseg doesn't regress).png    
Issue Links:
Problem/Incident
causes MDEV-28049 Error on compiling of trx0purge.cc Closed
is caused by MDEV-25062 InnoDB read-write workload hits conte... Closed

 Description   
  • In 10.6, trx_rseg_t mutex was ported to use latch. As part of this porting profiling of the patch was removed. This patch reenables it given that the said latch continues to occupy the top slots in the contention list

When I applied the said patch and enabled profiling trx_rseg_latch_key was 2nd hottest instrument from the InnoDB SE perspective.

wait/synch/cond/threadpool/worker_cond 46351983.3024 167603
wait/synch/mutex/innodb/log_sys_mutex 8716632.1922 122968738
wait/synch/cond/mysys/COND_timer 1516437.4227 5397
wait/synch/cond/threadpool/timer_cond 1515688.2689 3025
wait/synch/cond/aria/SERVICE_THREAD_CONTROL::COND_control 1501997.0416 50
wait/synch/rwlock/innodb/trx_rseg_latch_key 342616.7699 98834024


 Comments   
Comment by Krunal Bauskar [ 2022-02-24 ]

PR submitted: https://github.com/MariaDB/server/pull/2032

Comment by Marko Mäkelä [ 2022-02-24 ]

Thank you, Krunal! The patch looks good to me.

Can you please show the performance impact of this when performance_schema is available but globally disabled at runtime?

Comment by Marko Mäkelä [ 2022-02-24 ]

I had intentionally removed the PERFORMANCE_SCHEMA instrumentation in MDEV-25062 when replacing the mutexes with rw-locks. I stand corrected that it still is a serious contention point.

Comment by Krunal Bauskar [ 2022-02-24 ]

@Marko,

Please check the attached graph fro x86. There is no impact due to adding pfs support for the said latch.

Generated at Thu Feb 08 09:56:45 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.