Bug #54762 need to optimize the flush list code, buf_flush_batch() function
Submitted: 24 Jun 2010 6:42
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: InnoDB Plugin storage engine Severity:S4 (Feature request)
Version:plugin 1.0.9, innodb 1.1.1 OS:Any
Assigned to: CPU Architecture:Any

[24 Jun 2010 6:42] Shane Bester
This is a request to get rid of the requirement to hold buf_pool_mutex 
during this function.

It's also needed that the O(n²) algorithm be turned into O(n).
When the scan from the end of the LRU is restarted once for each page for which buf_flush_ready_for_flush() returns true. That will revisit pages on the LRU chain many times and if the last N elements of the LRU chain are ready for flushing, then this can visit N*N elements of the list.

How to repeat:
It's a known issue.  Read code, or chat to #innodb team.
[27 Mar 2014 14:47] Laurynas Biveinis
Can this be closed as fixed? 5.6 implemented hazard pointers for flush list flushes, 5.7 implemented them for LRU list flushes, and 5.6.16 has a hack to avoid LRU scan restarts.