Bug #104594 no need to maintain young and old area of LRU list
Submitted: 11 Aug 2021 10:54 Modified: 20 Nov 2023 11:12
Reporter: alex xing (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S5 (Performance)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[11 Aug 2021 10:54] alex xing
Description:
When BUF_FLUSH_SINGLE_PAGE or BUF_FLUSH_SINGLE_PAGE is used, this page will be removed from the LRU.  If the page is accessed by the user thread during flush, there is no need to move the page to the Young area, which will cause the expensive cost of  LRU_list_mutex.

How to repeat:
just read the code 

Suggested fix:
in Buf_fetch<T>::single_page, perhaps we  can determine the buF_IO_fix and flush_type of the page before calling buf_page_make_YOUNG_if_needed.
[11 Aug 2021 10:54] alex xing
a simple patch to describe the optimization

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: commit.patch (text/plain), 720 bytes.

[11 Aug 2021 11:01] alex xing
the above is just a simple patch, Extra attention may be required for compressed pages
[12 Aug 2021 11:35] MySQL Verification Team
Hi Mr. xing,

Thank you very much for your performance improvement report.

We do have couple of questions regarding your report.

First of all, have you measured what impact on performance your patch has with multiple concurrent reads ???

Second, we took a look at your patch and it seems that it is not complete ....

Can you complete your request by specifying exactly what else should be done to make a patch complete.

Thanks in advance.
[12 Aug 2021 12:15] alex xing
new patch

Attachment: commit_new .patch (text/plain), 696 bytes.

[12 Aug 2021 12:16] alex xing
new  patch

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: commit_new .patch (text/plain), 696 bytes.

[12 Aug 2021 12:17] MySQL Verification Team
Hi Mr. xing,

Thank you for your new patch.

We found that it is quite useful and we are thanking you for it.

Verified as reported.
[24 Apr 2022 4:08] alex xing
new patch

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: optimize.patch (text/plain), 712 bytes.

[27 Apr 2022 13:22] MySQL Verification Team
Thank you, Mr. xing.

Your patch will be treated as it should be, because it is coming from an OCA contributor.
[18 Oct 2023 10:32] Jakub Lopuszanski
Hi Alex Xing,
Have you run any performance tests to check the impact of your patch?
A priori, it looks like "a thread modifies the Least Recently Used page" is a very rare event even by definition.
[19 Nov 2023 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[20 Nov 2023 11:12] MySQL Verification Team
Hi,

We are returning this report into the "Verified" state ......

This means that reporter has not done any performance testing.

Hence, priority of this bug will depend if someone internal tests the performance gain.