Skip to content
Permalink
Browse files
MDEV-25801: buf_flush_dirty_pages() is very slow
In commit 7cffb5f (MDEV-23399)
the implementation of buf_flush_dirty_pages() was replaced with
a slow one, which would perform excessive scans of the
buf_pool.flush_list and make little progress.

buf_flush_list(), buf_flush_LRU(): Split from buf_flush_lists().
Vladislav Vaintroub noticed that we will not need to invoke
log_flush_task.wait() for the LRU eviction flushing.

buf_flush_list_space(): Replaces buf_flush_dirty_pages().
This is like buf_flush_list(), but operating on a single
tablespace at a time. Writes at most innodb_io_capacity
pages. Returns whether some of the tablespace might remain
in the buffer pool.
  • Loading branch information
dr-m committed Jun 23, 2021
1 parent 762bcb8 commit 8af5389
Show file tree
Hide file tree
Showing 9 changed files with 241 additions and 124 deletions.
@@ -1729,10 +1729,10 @@ 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(
ulint n_flushed = buf_flush_LRU(
std::max<ulint>(withdraw_target
- UT_LIST_GET_LEN(withdraw),
srv_LRU_scan_depth), 0);
srv_LRU_scan_depth));
buf_flush_wait_batch_end_acquiring_mutex(true);

if (n_flushed) {
@@ -3321,7 +3321,7 @@ buf_page_get_low(

fix_block->fix();
mysql_mutex_unlock(&buf_pool.mutex);
buf_flush_lists(ULINT_UNDEFINED, LSN_MAX);
buf_flush_list();
buf_flush_wait_batch_end_acquiring_mutex(false);

if (fix_block->page.buf_fix_count() == 1

0 comments on commit 8af5389

Please sign in to comment.