Bug #100119 Switch to use relaxed memory barrier for redo-log counters
Submitted: 6 Jul 7:07 Modified: 14 Aug 13:10
Reporter: Krunal Bauskar (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S5 (Performance)
Version:8.0.20 OS:Any
Assigned to: CPU Architecture:ARM
Tags: arm, memory-barrier, performance

[6 Jul 7:07] Krunal Bauskar
Description:
Switch to use relaxed memory barrier for redo-log counters

- REDO Log flow needs multiple counters to track stats like redo-log size,
  free-spaces, flushed_upto lsn, checkpoint_upto lsn, etc....

- All of these counters are meant to track the state of redo log and not for
  the so-called synchronization of critical resources.

- This naturally qualifies them to use relaxed memory barriers as proposed
  in the said patch.

How to repeat:
Apply the patch that I plan to submit as contribution and run some basic performance tests. I tried sysbench performance and observed performance gain with patch applied.
[6 Jul 7:08] Krunal Bauskar
patch for the bug

Attachment: perf#logtypes-memory-barrier.patch (text/x-patch), 4.62 KiB.

[6 Jul 7:09] Krunal Bauskar
arm benchmark

Attachment: arm.png (image/png, text), 104.72 KiB.

[6 Jul 7:09] Krunal Bauskar
x86 benchmark

Attachment: x86.png (image/png, text), 96.44 KiB.

[6 Jul 12:13] MySQL Verification Team
Hi Mr. Bauskar,

Thank your for your performance improvement report.

I have tested it and I conclude that it is correct.

Verified as reported.
[13 Aug 16:26] Sunny Bains
I see some drops with the patch esp. at 64 threads on Intel. This makes it difficult to accept the patch.
[14 Aug 12:08] MySQL Verification Team
Thank you Sunny.

This is a patch for ARM architectures only .......
[14 Aug 13:09] Krunal Bauskar
x86 re-benchmarked

Attachment: x86_8021.png (image/png, text), 48.86 KiB.

[14 Aug 13:10] Krunal Bauskar
I presume you tried the patch with 8.0.21.

Since I submitted the patch back with 8.0.20 (with performance results for both x86 and ARM) I thought may be something could have changed and so decided to give it a re-try with 8.0.21.

I am attaching the results for x86.
I don't see any regression for 64 threads (neither for higher scalability too).

------------------

It would be really helpful if you can share the complete result-set
along with configuration and test-case if you still see the regression.

I will try to reproduce it.
[14 Aug 13:55] MySQL Verification Team
Thank you, Mr. Bauskar.