diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index eb7dce0..4baa5ab 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -2658,14 +2658,11 @@ static void btr_cur_prefetch_siblings(buf_block_t *block) { if (left_page_no != FIL_NULL) { buf_read_page_background(page_id_t(block->page.id.space(), left_page_no), - block->page.size, false); + block->page.size, false, true); } if (right_page_no != FIL_NULL) { buf_read_page_background(page_id_t(block->page.id.space(), right_page_no), - block->page.size, false); - } - if (left_page_no != FIL_NULL || right_page_no != FIL_NULL) { - os_aio_simulated_wake_handler_threads(); + block->page.size, false, true); } } diff --git a/storage/innobase/buf/buf0dump.cc b/storage/innobase/buf/buf0dump.cc index f88464d..4a1bd00 100644 --- a/storage/innobase/buf/buf0dump.cc +++ b/storage/innobase/buf/buf0dump.cc @@ -610,7 +610,7 @@ static void buf_load() { } buf_read_page_background(page_id_t(this_space_id, BUF_DUMP_PAGE(dump[i])), - page_size, true); + page_size, true, false); if (i % 64 == 63) { os_aio_simulated_wake_handler_threads(); diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc index 5928af0..f8e28b7 100644 --- a/storage/innobase/buf/buf0rea.cc +++ b/storage/innobase/buf/buf0rea.cc @@ -346,14 +346,19 @@ released by the i/o-handler thread. @param[in] page_id page id @param[in] page_size page size @param[in] sync true if synchronous aio is desired +@param[in] wakeup wakeup IO thread immediately @return true if page has been read in, false in case of failure */ ibool buf_read_page_background(const page_id_t &page_id, - const page_size_t &page_size, bool sync) { + const page_size_t &page_size, bool sync, bool wakeup) { ulint count; dberr_t err; - count = buf_read_page_low(&err, sync, - IORequest::DO_NOT_WAKE | IORequest::IGNORE_MISSING, + ulint type = IORequest::IGNORE_MISSING; + if (!wakeup) { + type |= IORequest::DO_NOT_WAKE; + } + + count = buf_read_page_low(&err, sync, type, BUF_READ_ANY_PAGE, page_id, page_size, false); srv_stats.buf_pool_reads.add(count); diff --git a/storage/innobase/include/buf0rea.h b/storage/innobase/include/buf0rea.h index e52caa0..22626b3 100644 --- a/storage/innobase/include/buf0rea.h +++ b/storage/innobase/include/buf0rea.h @@ -53,9 +53,10 @@ released by the i/o-handler thread. @param[in] page_id page id @param[in] page_size page size @param[in] sync true if synchronous aio is desired +@param[in] wakeup wakeup IO thread immediately @return true if page has been read in, false in case of failure */ ibool buf_read_page_background(const page_id_t &page_id, - const page_size_t &page_size, bool sync); + const page_size_t &page_size, bool sync, bool wakeup); /** Applies a random read-ahead in buf_pool if there are at least a threshold value of accessed pages from the random read-ahead area. Does not read any