diff options
-rw-r--r-- | mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result | 8 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/innodb_status_variables.result | 1 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/monitor.result | 4 | ||||
-rw-r--r-- | storage/innobase/buf/buf0buf.cc | 10 | ||||
-rw-r--r-- | storage/innobase/buf/buf0flu.cc | 21 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 1 | ||||
-rw-r--r-- | storage/innobase/include/buf0flu.h | 2 | ||||
-rw-r--r-- | storage/innobase/include/srv0mon.h | 4 | ||||
-rw-r--r-- | storage/innobase/srv/srv0mon.cc | 38 | ||||
-rw-r--r-- | storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result | 8 |
10 files changed, 31 insertions, 66 deletions
diff --git a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result index f97fe29cc36..0f0d3169779 100644 --- a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result +++ b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result @@ -110,12 +110,8 @@ buffer_flush_background_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL buffer_LRU_batch_scanned buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_owner Total pages scanned as part of LRU batch buffer_LRU_batch_num_scan buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Number of times LRU batch is called buffer_LRU_batch_scanned_per_call buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Pages scanned per LRU batch call -buffer_LRU_batch_flush_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_owner Total pages flushed as part of LRU batches -buffer_LRU_batches_flush buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Number of LRU batches -buffer_LRU_batch_flush_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Pages queued as an LRU batch -buffer_LRU_batch_evict_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_owner Total pages evicted as part of LRU batches -buffer_LRU_batches_evict buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Number of LRU batches -buffer_LRU_batch_evict_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Pages queued as an LRU batch +buffer_LRU_batch_flush_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Total pages flushed as part of LRU batches +buffer_LRU_batch_evict_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Total pages evicted as part of LRU batches buffer_LRU_single_flush_failure_count Buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of times attempt to flush a single page from LRU failed buffer_LRU_get_free_search Buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of searches performed for a clean page buffer_LRU_search_scanned buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_owner Total pages scanned as part of LRU search diff --git a/mysql-test/suite/innodb/r/innodb_status_variables.result b/mysql-test/suite/innodb/r/innodb_status_variables.result index 0eda793621c..da5020bbe08 100644 --- a/mysql-test/suite/innodb/r/innodb_status_variables.result +++ b/mysql-test/suite/innodb/r/innodb_status_variables.result @@ -22,6 +22,7 @@ INNODB_BUFFER_POOL_PAGES_MISC INNODB_BUFFER_POOL_PAGES_OLD INNODB_BUFFER_POOL_PAGES_TOTAL INNODB_BUFFER_POOL_PAGES_LRU_FLUSHED +INNODB_BUFFER_POOL_PAGES_LRU_FREED INNODB_BUFFER_POOL_READ_AHEAD_RND INNODB_BUFFER_POOL_READ_AHEAD INNODB_BUFFER_POOL_READ_AHEAD_EVICTED diff --git a/mysql-test/suite/innodb/r/monitor.result b/mysql-test/suite/innodb/r/monitor.result index bab301c8d54..152941ce54e 100644 --- a/mysql-test/suite/innodb/r/monitor.result +++ b/mysql-test/suite/innodb/r/monitor.result @@ -77,11 +77,7 @@ buffer_LRU_batch_scanned disabled buffer_LRU_batch_num_scan disabled buffer_LRU_batch_scanned_per_call disabled buffer_LRU_batch_flush_total_pages disabled -buffer_LRU_batches_flush disabled -buffer_LRU_batch_flush_pages disabled buffer_LRU_batch_evict_total_pages disabled -buffer_LRU_batches_evict disabled -buffer_LRU_batch_evict_pages disabled buffer_LRU_single_flush_failure_count disabled buffer_LRU_get_free_search disabled buffer_LRU_search_scanned disabled diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 273178c164f..b1307801b3e 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -1717,19 +1717,11 @@ inline bool buf_pool_t::withdraw_blocks() /* reserve free_list length */ if (UT_LIST_GET_LEN(withdraw) < withdraw_target) { - ulint n_flushed = buf_flush_lists( + buf_flush_lists( std::max<ulint>(withdraw_target - UT_LIST_GET_LEN(withdraw), srv_LRU_scan_depth), 0); buf_flush_wait_batch_end_acquiring_mutex(true); - - if (n_flushed) { - MONITOR_INC_VALUE_CUMULATIVE( - MONITOR_LRU_BATCH_FLUSH_TOTAL_PAGE, - MONITOR_LRU_BATCH_FLUSH_COUNT, - MONITOR_LRU_BATCH_FLUSH_PAGES, - n_flushed); - } } /* relocate blocks/buddies in withdrawn area */ diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 57adb45bc9b..7df0739d9fb 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -57,6 +57,9 @@ Created 11/11/1995 Heikki Tuuri Also included in buf_flush_page_count. */ ulint buf_lru_flush_page_count; +/** Number of pages freed without flushing. Protected by buf_pool.mutex. */ +ulint buf_lru_freed_page_count; + /** Number of pages flushed. Protected by buf_pool.mutex. */ ulint buf_flush_page_count; @@ -1347,13 +1350,6 @@ reacquire_mutex: if (space) space->release(); - /* We keep track of all flushes happening as part of LRU flush. When - estimating the desired rate at which flush_list should be flushed, - we factor in this value. */ - buf_lru_flush_page_count+= n->flushed; - - mysql_mutex_assert_owner(&buf_pool.mutex); - if (scanned) MONITOR_INC_VALUE_CUMULATIVE(MONITOR_LRU_BATCH_SCANNED, MONITOR_LRU_BATCH_SCANNED_NUM_CALL, @@ -1374,14 +1370,13 @@ static ulint buf_do_LRU_batch(ulint max) n.flushed= 0; n.evicted= n_unzip_LRU_evicted; buf_flush_LRU_list_batch(max, &n); + mysql_mutex_assert_owner(&buf_pool.mutex); if (const ulint evicted= n.evicted - n_unzip_LRU_evicted) - { - MONITOR_INC_VALUE_CUMULATIVE(MONITOR_LRU_BATCH_EVICT_TOTAL_PAGE, - MONITOR_LRU_BATCH_EVICT_COUNT, - MONITOR_LRU_BATCH_EVICT_PAGES, - evicted); - } + buf_lru_freed_page_count+= evicted; + + if (n.flushed) + buf_lru_flush_page_count+= n.flushed; return n.flushed; } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index ccd37d9e083..c103e636a80 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -950,6 +950,7 @@ static SHOW_VAR innodb_status_variables[]= { {"buffer_pool_pages_total", &export_vars.innodb_buffer_pool_pages_total, SHOW_SIZE_T}, {"buffer_pool_pages_LRU_flushed", &buf_lru_flush_page_count, SHOW_SIZE_T}, + {"buffer_pool_pages_LRU_freed", &buf_lru_freed_page_count, SHOW_SIZE_T}, {"buffer_pool_read_ahead_rnd", &export_vars.innodb_buffer_pool_read_ahead_rnd, SHOW_SIZE_T}, {"buffer_pool_read_ahead", diff --git a/storage/innobase/include/buf0flu.h b/storage/innobase/include/buf0flu.h index 1dd0d35793b..800c707bab9 100644 --- a/storage/innobase/include/buf0flu.h +++ b/storage/innobase/include/buf0flu.h @@ -36,6 +36,8 @@ extern ulint buf_flush_page_count; /** Number of pages flushed via LRU. Protected by buf_pool.mutex. Also included in buf_flush_page_count. */ extern ulint buf_lru_flush_page_count; +/** Number of pages freed without flushing. Protected by buf_pool.mutex. */ +extern ulint buf_lru_freed_page_count; /** Flag indicating if the page_cleaner is in active state. */ extern bool buf_page_cleaner_is_active; diff --git a/storage/innobase/include/srv0mon.h b/storage/innobase/include/srv0mon.h index 657f003ddf9..ae5aa6af7b0 100644 --- a/storage/innobase/include/srv0mon.h +++ b/storage/innobase/include/srv0mon.h @@ -220,11 +220,7 @@ enum monitor_id_t { MONITOR_LRU_BATCH_SCANNED_NUM_CALL, MONITOR_LRU_BATCH_SCANNED_PER_CALL, MONITOR_LRU_BATCH_FLUSH_TOTAL_PAGE, - MONITOR_LRU_BATCH_FLUSH_COUNT, - MONITOR_LRU_BATCH_FLUSH_PAGES, MONITOR_LRU_BATCH_EVICT_TOTAL_PAGE, - MONITOR_LRU_BATCH_EVICT_COUNT, - MONITOR_LRU_BATCH_EVICT_PAGES, MONITOR_LRU_SINGLE_FLUSH_FAILURE_COUNT, MONITOR_LRU_GET_FREE_SEARCH, MONITOR_LRU_SEARCH_SCANNED, diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc index 3126c098ba9..b10c07a192f 100644 --- a/storage/innobase/srv/srv0mon.cc +++ b/storage/innobase/srv/srv0mon.cc @@ -495,34 +495,16 @@ static monitor_info_t innodb_counter_info[] = /* Cumulative counter for LRU batch pages flushed */ {"buffer_LRU_batch_flush_total_pages", "buffer", "Total pages flushed as part of LRU batches", - 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}, + static_cast<monitor_type_t>( + MONITOR_EXISTING | MONITOR_DEFAULT_ON), + MONITOR_DEFAULT_START, MONITOR_LRU_BATCH_FLUSH_TOTAL_PAGE}, /* 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_evict", "buffer", - "Number of LRU batches", - MONITOR_SET_MEMBER, MONITOR_LRU_BATCH_EVICT_TOTAL_PAGE, - MONITOR_LRU_BATCH_EVICT_COUNT}, - - {"buffer_LRU_batch_evict_pages", "buffer", - "Pages queued as an LRU batch", - MONITOR_SET_MEMBER, MONITOR_LRU_BATCH_EVICT_TOTAL_PAGE, - MONITOR_LRU_BATCH_EVICT_PAGES}, + static_cast<monitor_type_t>( + MONITOR_EXISTING | MONITOR_DEFAULT_ON), + MONITOR_DEFAULT_START, MONITOR_LRU_BATCH_EVICT_TOTAL_PAGE}, {"buffer_LRU_single_flush_failure_count", "Buffer", "Number of times attempt to flush a single page from LRU failed", @@ -1575,6 +1557,14 @@ srv_mon_process_existing_counter( value = srv_stats.non_index_pages_written; break; + case MONITOR_LRU_BATCH_FLUSH_TOTAL_PAGE: + value = buf_lru_flush_page_count; + break; + + case MONITOR_LRU_BATCH_EVICT_TOTAL_PAGE: + value = buf_lru_freed_page_count; + break; + /* innodb_pages_read */ case MONITOR_OVLD_PAGES_READ: value = buf_pool.stat.n_pages_read; diff --git a/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result b/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result index ba00029f275..ad0e7b31af7 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result @@ -92,12 +92,8 @@ buffer_flush_background_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL buffer_LRU_batch_scanned buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_owner Total pages scanned as part of LRU batch buffer_LRU_batch_num_scan buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Number of times LRU batch is called buffer_LRU_batch_scanned_per_call buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Pages scanned per LRU batch call -buffer_LRU_batch_flush_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_owner Total pages flushed as part of LRU batches -buffer_LRU_batches_flush buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Number of LRU batches -buffer_LRU_batch_flush_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Pages queued as an LRU batch -buffer_LRU_batch_evict_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_owner Total pages evicted as part of LRU batches -buffer_LRU_batches_evict buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Number of LRU batches -buffer_LRU_batch_evict_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Pages queued as an LRU batch +buffer_LRU_batch_flush_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Total pages flushed as part of LRU batches +buffer_LRU_batch_evict_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Total pages evicted as part of LRU batches buffer_LRU_single_flush_failure_count Buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of times attempt to flush a single page from LRU failed buffer_LRU_get_free_search Buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of searches performed for a clean page buffer_LRU_search_scanned buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_owner Total pages scanned as part of LRU search |