summaryrefslogtreecommitdiff
path: root/storage/innobase/include
diff options
context:
space:
mode:
authorKrunal Bauskar <mysqlonarm@gmail.com>2021-02-23 16:21:30 +0800
committerMarko Mäkelä <marko.makela@mariadb.com>2021-03-11 08:14:26 +0200
commitf11b60879beba19798a76e17af206a95fd8fd204 (patch)
tree204d1a927e7ef6d5fb98c9f77668bc1ddf294075 /storage/innobase/include
parent1799caa3a1305d21acaa37169e6b14307b4b5f08 (diff)
downloadmariadb-git-f11b60879beba19798a76e17af206a95fd8fd204.tar.gz
MDEV-24949: Enabling idle flushing (possible regression from MDEV-23855)
- Currently page cleaner thread will stop flushing if dirty_pct < innodb_max_dirty_pages_pct_lwm. - If the server is not performing any activity then said resources/time could be used to flush the pending dirty pages and keep buffer pool clean for the next burst of the cycle. This flushing is called idle flushing. - flushing logic underwent a complete revamp in 10.5.7/8 and as part of the revamp idle flushing logic got removed. - New proposed logic of idle flushing is based on updated logic of the page cleaner that will enable idle flushing if - buf page cleaner is idle - there are dirty pages (< innodb_max_dirty_pages_pct_lwm) - server is not performing any activity Logic will kickstart the idle flushing bounded by innodb_io_capacity. (Thanks to Marko Makela for reviewing the patch and idea right from the its inception).
Diffstat (limited to 'storage/innobase/include')
-rw-r--r--storage/innobase/include/buf0buf.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
index 12fb139f1bf..deff8054362 100644
--- a/storage/innobase/include/buf0buf.h
+++ b/storage/innobase/include/buf0buf.h
@@ -1946,6 +1946,8 @@ public:
private:
/** whether the page cleaner needs wakeup from indefinite sleep */
bool page_cleaner_is_idle;
+ /** track server activity count for signaling idle flushing */
+ ulint last_activity_count;
public:
/** signalled to wake up the page_cleaner; protected by flush_list_mutex */
pthread_cond_t do_flush_list;
@@ -1966,6 +1968,13 @@ public:
page_cleaner_is_idle= deep_sleep;
}
+ /** Update server last activity count */
+ void update_last_activity_count(ulint activity_count)
+ {
+ mysql_mutex_assert_owner(&flush_list_mutex);
+ last_activity_count= activity_count;
+ }
+
// n_flush_LRU + n_flush_list is approximately COUNT(io_fix()==BUF_IO_WRITE)
// in flush_list