From f11b60879beba19798a76e17af206a95fd8fd204 Mon Sep 17 00:00:00 2001 From: Krunal Bauskar Date: Tue, 23 Feb 2021 16:21:30 +0800 Subject: 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). --- storage/innobase/include/buf0buf.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'storage/innobase/include') 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 -- cgit v1.2.1