Please sign in to comment.
Buffer pool list scan optimization
Summary: Feature: Optimize buffer pool list scans and fix reporting This patch includes: -- backport of upstream work around buffer pool list scan. revno: 6228 revision-id: email@example.com parent: firstname.lastname@example.org committer: Sunny Bains <Sunny.Bains@Oracle.Com> branch nick: trunk timestamp: Fri 2013-08-09 08:37:45 +1000 message: WL#7047 - Optimize buffer pool list scans and related batch processing code Reduce excessive scanning of pages when doing flush list batches. The fix is to introduce the concept of "Hazard Pointer", this reduces the time complexity of the scan from O(n*n) to O(n). The concept of hazard pointer is reversed in this work. Academically a hazard pointer is a pointer that the thread working on it will declare as such and as long as that thread is not done no other thread is allowed to do anything with it. In this WL we declare the pointer as a hazard pointer and then if any other thread attempts to work on it, it is allowed to do so but it has to adjust the hazard pointer to the next valid value. We use hazard pointer solely for reverse traversal of lists within a buffer pool instance. Add an event to control the background flush thread. The background flush thread wait has been converted to an os event timed wait so that it can be signalled by threads that want to kick start a background flush when the buffer pool is running low on free/dirty pages. -- fix for mysql bug#71411 buf_flush_LRU() returns the number of pages processed. There are two types of processing that can happen. A page can get evicted or a page can get flushed. These two numbers are quite distinct and should not be mixed. Test Plan: mtr Reviewers: pivanof, liang.guo.752, CalvinSun Reviewed By: pivanof CC: jtolmer, MarkCallaghan, flamingcow, jeremycole, andrew-ford, pengt, steaphan Differential Revision: https://reviews.facebook.net/D16629
- Loading branch information...
Showing with 602 additions and 422 deletions.
- +6 −4 mysql-test/suite/innodb/r/innodb_monitor.result
- +6 −4 mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result
- +6 −4 mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result
- +6 −4 mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result
- +6 −4 mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result
- +124 −4 storage/innobase/buf/buf0buf.cc
- +182 −322 storage/innobase/buf/buf0flu.cc
- +67 −45 storage/innobase/buf/buf0lru.cc
- +144 −2 storage/innobase/include/buf0buf.h
- +9 −6 storage/innobase/include/buf0flu.h
- +11 −4 storage/innobase/include/buf0lru.h
- +6 −4 storage/innobase/include/srv0mon.h
- +4 −1 storage/innobase/log/log0recv.cc
- +25 −14 storage/innobase/srv/srv0mon.cc
Oops, something went wrong.