diff options
author | Jan Lindström <jan.lindstrom@skysql.com> | 2014-11-06 13:17:11 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@skysql.com> | 2014-11-06 13:17:11 +0200 |
commit | a03dd94be804a4b8b1406696920834bb2c0bedbd (patch) | |
tree | 620b6a4dc5b401b0688f31b7fafc3de617a72f29 /storage/innobase/srv | |
parent | 84de27709913fa6dcb90f535d54cd866f2ba5b7f (diff) | |
download | mariadb-git-a03dd94be804a4b8b1406696920834bb2c0bedbd.tar.gz |
MDEV-6936: Buffer pool list scan optimization
Merged Facebook commit 617aef9f911d825e9053f3d611d0389e02031225
authored by Inaam Rana to InnoDB storage engine (not XtraDB)
from https://github.com/facebook/mysql-5.6
WL#7047 - Optimize buffer pool list scans and related batch processing
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.
The concept of hazard pointer is reversed in this work. Academically
hazard pointer is a pointer that the thread working on it will declar
such and as long as that thread is not done no other thread is allowe
do anything with it.
In this WL we declare the pointer as a hazard pointer and then if any
thread attempts to work on it, it is allowed to do so but it has to a
the hazard pointer to the next valid value. We use hazard pointer sol
reverse traversal of lists within a buffer pool instance.
Add an event to control the background flush thread. The background f
thread wait has been converted to an os event timed wait so that it c
signalled by threads that want to kick start a background flush when
buffer pool is running low on free/dirty pages.
Diffstat (limited to 'storage/innobase/srv')
-rw-r--r-- | storage/innobase/srv/srv0mon.cc | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc index 44e228dc523..558464e1b47 100644 --- a/storage/innobase/srv/srv0mon.cc +++ b/storage/innobase/srv/srv0mon.cc @@ -350,11 +350,6 @@ static monitor_info_t innodb_counter_info[] = MONITOR_SET_MEMBER, MONITOR_FLUSH_BATCH_SCANNED, MONITOR_FLUSH_BATCH_SCANNED_PER_CALL}, - {"buffer_flush_batch_rescan", "buffer", - "Number of times rescan of flush list forced", - MONITOR_NONE, - MONITOR_DEFAULT_START, MONITOR_FLUSH_HP_RESCAN}, - /* Cumulative counter for pages flushed in flush batches */ {"buffer_flush_batch_total_pages", "buffer", "Total pages flushed as part of flush batch", @@ -482,20 +477,36 @@ static monitor_info_t innodb_counter_info[] = MONITOR_LRU_BATCH_SCANNED_PER_CALL}, /* Cumulative counter for LRU batch pages flushed */ - {"buffer_LRU_batch_total_pages", "buffer", + {"buffer_LRU_batch_flush_total_pages", "buffer", "Total pages flushed as part of LRU batches", - MONITOR_SET_OWNER, MONITOR_LRU_BATCH_COUNT, - MONITOR_LRU_BATCH_TOTAL_PAGE}, + MONITOR_SET_OWNER, MONITOR_LRU_BATCH_FLUSH_COUNT, + MONITOR_LRU_BATCH_FLUSH_TOTAL_PAGE}, + + {"buffer_LRU_batches_flush", "buffer", + "Number of LRU batches", + MONITOR_SET_MEMBER, MONITOR_LRU_BATCH_FLUSH_TOTAL_PAGE, + MONITOR_LRU_BATCH_FLUSH_COUNT}, + + {"buffer_LRU_batch_flush_pages", "buffer", + "Pages queued as an LRU batch", + MONITOR_SET_MEMBER, MONITOR_LRU_BATCH_FLUSH_TOTAL_PAGE, + MONITOR_LRU_BATCH_FLUSH_PAGES}, + + /* Cumulative counter for LRU batch pages flushed */ + {"buffer_LRU_batch_evict_total_pages", "buffer", + "Total pages evicted as part of LRU batches", + MONITOR_SET_OWNER, MONITOR_LRU_BATCH_EVICT_COUNT, + MONITOR_LRU_BATCH_EVICT_TOTAL_PAGE}, - {"buffer_LRU_batches", "buffer", + {"buffer_LRU_batches_evict", "buffer", "Number of LRU batches", - MONITOR_SET_MEMBER, MONITOR_LRU_BATCH_TOTAL_PAGE, - MONITOR_LRU_BATCH_COUNT}, + MONITOR_SET_MEMBER, MONITOR_LRU_BATCH_EVICT_TOTAL_PAGE, + MONITOR_LRU_BATCH_EVICT_COUNT}, - {"buffer_LRU_batch_pages", "buffer", + {"buffer_LRU_batch_evict_pages", "buffer", "Pages queued as an LRU batch", - MONITOR_SET_MEMBER, MONITOR_LRU_BATCH_TOTAL_PAGE, - MONITOR_LRU_BATCH_PAGES}, + MONITOR_SET_MEMBER, MONITOR_LRU_BATCH_EVICT_TOTAL_PAGE, + MONITOR_LRU_BATCH_EVICT_PAGES}, /* Cumulative counter for single page LRU scans */ {"buffer_LRU_single_flush_scanned", "buffer", |