diff options
Diffstat (limited to 'storage/innobase/include')
-rw-r--r-- | storage/innobase/include/buf0buf.h | 24 | ||||
-rw-r--r-- | storage/innobase/include/buf0buf.ic | 19 |
2 files changed, 6 insertions, 37 deletions
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h index 522441259dd..58a4f718a6e 100644 --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -930,18 +930,8 @@ public: purposes without holding any mutex or latch */ /* @} */ - Atomic_counter<unsigned> access_time; /*!< time of first access, or - 0 if the block was never accessed - in the buffer pool. - - For state==BUF_BLOCK_MEMORY - blocks, this field can be repurposed - for something else. - - When this field counts log records - and bytes allocated for recv_sys.pages, - the field is protected by - recv_sys_t::mutex. */ + /** used by recv_sys_t::add() only */ + unsigned access_time; /** Change buffer entries for the page exist. Protected by io_fix()==BUF_IO_READ or by buf_block_t::lock. */ bool ibuf_exist; @@ -974,7 +964,6 @@ public: buf_fix_count_= 0; old= 0; freed_page_clock= 0; - access_time= 0; oldest_modification_= 0; slot= nullptr; ibuf_exist= false; @@ -1088,15 +1077,10 @@ public: inline void set_old(bool old); /** Flag a page accessed in buf_pool @return whether this is not the first access */ - bool set_accessed() - { - if (is_accessed()) return true; - access_time= static_cast<uint32_t>(ut_time_ms()); - return false; - } + bool set_accessed() const { return false; } /** @return ut_time_ms() at the time of first access of a block in buf_pool @retval 0 if not accessed */ - unsigned is_accessed() const { ut_ad(in_file()); return access_time; } + unsigned is_accessed() const { ut_ad(in_file()); return 0; } }; /** The buffer control block structure */ diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic index bace66d5a39..3661820fd12 100644 --- a/storage/innobase/include/buf0buf.ic +++ b/storage/innobase/include/buf0buf.ic @@ -100,23 +100,8 @@ inline bool buf_page_peek_if_too_old(const buf_page_t *bpage) statistics or move blocks in the LRU list. This is either the warm-up phase or an in-memory workload. */ return(FALSE); - } else if (buf_LRU_old_threshold_ms && bpage->old) { - uint32_t access_time = bpage->is_accessed(); - - /* It is possible that the below comparison returns an - unexpected result. 2^32 milliseconds pass in about 50 days, - so if the difference between ut_time_ms() and access_time - is e.g. 50 days + 15 ms, then the below will behave as if - it is 15 ms. This is known and fixing it would require to - increase buf_page_t::access_time from 32 to 64 bits. */ - if (access_time - && ((ib_uint32_t) (ut_time_ms() - access_time)) - >= buf_LRU_old_threshold_ms) { - return(TRUE); - } - - buf_pool.stat.n_pages_not_made_young++; - return false; + } else if (bpage->old && buf_LRU_old_threshold_ms) { + return true; } else { return !buf_page_peek_if_young(bpage); } |