`try_lock()` in InnoDB codes is an atomic operation. For example, it's compiled to "lock cmpxchg" in x86. It will force cacheline to be exclusive state and suffer significant performance degradation in heavy contended scenarios when many CPUs `try_lock()`.
I collected a perf report and it's assembly codes in my benchmark. Attach them in files.
Look at the TTASEventMutex implementation, for instance. We mark the codes, always check whether lock is free at first, then `try_lock()`.
Based on real real-world workload test on a 224 CPUs x86 server, this change
brings back 60%+ TPS/perf for MariaDB 10.3.