Commit 288af748 authored by Marko Mäkelä's avatar Marko Mäkelä

WIP: Disable buf_page_t::access_time

parent 1b01833a
...@@ -11,7 +11,7 @@ INNODB_BUFFER_PAGE_LRU CREATE TEMPORARY TABLE `INNODB_BUFFER_PAGE_LRU` ( ...@@ -11,7 +11,7 @@ INNODB_BUFFER_PAGE_LRU CREATE TEMPORARY TABLE `INNODB_BUFFER_PAGE_LRU` (
`IS_HASHED` int(1) NOT NULL DEFAULT 0, `IS_HASHED` int(1) NOT NULL DEFAULT 0,
`NEWEST_MODIFICATION` bigint(21) unsigned NOT NULL DEFAULT 0, `NEWEST_MODIFICATION` bigint(21) unsigned NOT NULL DEFAULT 0,
`OLDEST_MODIFICATION` bigint(21) unsigned NOT NULL DEFAULT 0, `OLDEST_MODIFICATION` bigint(21) unsigned NOT NULL DEFAULT 0,
`ACCESS_TIME` bigint(21) unsigned NOT NULL DEFAULT 0, `ACCESS_TIME` bigint(21) unsigned DEFAULT NULL,
`TABLE_NAME` varchar(1024) DEFAULT NULL, `TABLE_NAME` varchar(1024) DEFAULT NULL,
`INDEX_NAME` varchar(64) DEFAULT NULL, `INDEX_NAME` varchar(64) DEFAULT NULL,
`NUMBER_RECORDS` bigint(21) unsigned NOT NULL DEFAULT 0, `NUMBER_RECORDS` bigint(21) unsigned NOT NULL DEFAULT 0,
......
...@@ -2512,7 +2512,6 @@ inline buf_page_t *buf_pool_t::watch_set(const page_id_t id, ...@@ -2512,7 +2512,6 @@ inline buf_page_t *buf_pool_t::watch_set(const page_id_t id,
watch when setting another watch. */ watch when setting another watch. */
for (buf_page_t *w= &watch[UT_ARR_SIZE(watch)]; w-- >= watch; ) for (buf_page_t *w= &watch[UT_ARR_SIZE(watch)]; w-- >= watch; )
{ {
ut_ad(w->access_time == 0);
ut_ad(!w->oldest_modification()); ut_ad(!w->oldest_modification());
ut_ad(!w->zip.data); ut_ad(!w->zip.data);
ut_ad(!w->in_zip_hash); ut_ad(!w->in_zip_hash);
...@@ -3002,7 +3001,6 @@ buf_page_get_low( ...@@ -3002,7 +3001,6 @@ buf_page_get_low(
bool allow_ibuf_merge) bool allow_ibuf_merge)
{ {
buf_block_t* block; buf_block_t* block;
unsigned access_time;
ulint retries = 0; ulint retries = 0;
const ulint fold = page_id.fold(); const ulint fold = page_id.fold();
...@@ -3356,9 +3354,7 @@ buf_page_get_low( ...@@ -3356,9 +3354,7 @@ buf_page_get_low(
rw_lock_x_unlock(hash_lock); rw_lock_x_unlock(hash_lock);
buf_pool.n_pend_unzip++; buf_pool.n_pend_unzip++;
access_time = block->page.is_accessed(); if (UNIV_UNLIKELY(!recv_no_ibuf_operations)
if (!access_time && !recv_no_ibuf_operations
&& ibuf_page_exists(block->page.id(), zip_size)) { && ibuf_page_exists(block->page.id(), zip_size)) {
block->page.ibuf_exist = true; block->page.ibuf_exist = true;
} }
......
...@@ -116,7 +116,6 @@ struct buf_page_info_t{ ...@@ -116,7 +116,6 @@ struct buf_page_info_t{
ulint block_id; /*!< Buffer Pool block ID */ ulint block_id; /*!< Buffer Pool block ID */
/** page identifier */ /** page identifier */
page_id_t id; page_id_t id;
unsigned access_time:32; /*!< Time of first access */
unsigned io_fix:2; /*!< type of pending I/O operation */ unsigned io_fix:2; /*!< type of pending I/O operation */
uint32_t fix_count; /*!< Count of how manyfold this block uint32_t fix_count; /*!< Count of how manyfold this block
is bufferfixed */ is bufferfixed */
...@@ -3996,8 +3995,7 @@ i_s_innodb_buffer_page_fill( ...@@ -3996,8 +3995,7 @@ i_s_innodb_buffer_page_fill(
OK(fields[IDX_BUFFER_PAGE_OLDEST_MOD]->store( OK(fields[IDX_BUFFER_PAGE_OLDEST_MOD]->store(
page_info->oldest_mod, true)); page_info->oldest_mod, true));
OK(fields[IDX_BUFFER_PAGE_ACCESS_TIME]->store( fields[IDX_BUFFER_PAGE_ACCESS_TIME]->set_null();
page_info->access_time, true));
fields[IDX_BUFFER_PAGE_TABLE_NAME]->set_null(); fields[IDX_BUFFER_PAGE_TABLE_NAME]->set_null();
...@@ -4168,8 +4166,6 @@ i_s_innodb_buffer_page_get_info( ...@@ -4168,8 +4166,6 @@ i_s_innodb_buffer_page_get_info(
page_info->oldest_mod = bpage->oldest_modification(); page_info->oldest_mod = bpage->oldest_modification();
page_info->access_time = bpage->access_time;
page_info->zip_ssize = bpage->zip.ssize; page_info->zip_ssize = bpage->zip.ssize;
page_info->io_fix = bpage->io_fix() & 3; page_info->io_fix = bpage->io_fix() & 3;
...@@ -4408,7 +4404,7 @@ static ST_FIELD_INFO i_s_innodb_buf_page_lru_fields_info[] = ...@@ -4408,7 +4404,7 @@ static ST_FIELD_INFO i_s_innodb_buf_page_lru_fields_info[] =
Column("OLDEST_MODIFICATION",ULonglong(), NOT_NULL), Column("OLDEST_MODIFICATION",ULonglong(), NOT_NULL),
#define IDX_BUF_LRU_PAGE_ACCESS_TIME 9 + I_S_AHI #define IDX_BUF_LRU_PAGE_ACCESS_TIME 9 + I_S_AHI
Column("ACCESS_TIME",ULonglong(), NOT_NULL), Column("ACCESS_TIME",ULonglong(), NULLABLE),
#define IDX_BUF_LRU_PAGE_TABLE_NAME 10 + I_S_AHI #define IDX_BUF_LRU_PAGE_TABLE_NAME 10 + I_S_AHI
Column("TABLE_NAME", Varchar(1024), NULLABLE), Column("TABLE_NAME", Varchar(1024), NULLABLE),
...@@ -4500,8 +4496,7 @@ i_s_innodb_buf_page_lru_fill( ...@@ -4500,8 +4496,7 @@ i_s_innodb_buf_page_lru_fill(
OK(fields[IDX_BUF_LRU_PAGE_OLDEST_MOD]->store( OK(fields[IDX_BUF_LRU_PAGE_OLDEST_MOD]->store(
page_info->oldest_mod, true)); page_info->oldest_mod, true));
OK(fields[IDX_BUF_LRU_PAGE_ACCESS_TIME]->store( fields[IDX_BUF_LRU_PAGE_ACCESS_TIME]->set_null();
page_info->access_time, true));
fields[IDX_BUF_LRU_PAGE_TABLE_NAME]->set_null(); fields[IDX_BUF_LRU_PAGE_TABLE_NAME]->set_null();
......
...@@ -930,18 +930,8 @@ class buf_page_t ...@@ -930,18 +930,8 @@ class buf_page_t
purposes without holding any purposes without holding any
mutex or latch */ mutex or latch */
/* @} */ /* @} */
Atomic_counter<unsigned> access_time; /*!< time of first access, or /** used by recv_sys_t::add() only */
0 if the block was never accessed unsigned access_time;
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. */
/** Change buffer entries for the page exist. /** Change buffer entries for the page exist.
Protected by io_fix()==BUF_IO_READ or by buf_block_t::lock. */ Protected by io_fix()==BUF_IO_READ or by buf_block_t::lock. */
bool ibuf_exist; bool ibuf_exist;
...@@ -974,7 +964,6 @@ class buf_page_t ...@@ -974,7 +964,6 @@ class buf_page_t
buf_fix_count_= 0; buf_fix_count_= 0;
old= 0; old= 0;
freed_page_clock= 0; freed_page_clock= 0;
access_time= 0;
oldest_modification_= 0; oldest_modification_= 0;
slot= nullptr; slot= nullptr;
ibuf_exist= false; ibuf_exist= false;
...@@ -1088,15 +1077,10 @@ class buf_page_t ...@@ -1088,15 +1077,10 @@ class buf_page_t
inline void set_old(bool old); inline void set_old(bool old);
/** Flag a page accessed in buf_pool /** Flag a page accessed in buf_pool
@return whether this is not the first access */ @return whether this is not the first access */
bool set_accessed() bool set_accessed() const { return false; }
{
if (is_accessed()) return true;
access_time= static_cast<uint32_t>(ut_time_ms());
return false;
}
/** @return ut_time_ms() at the time of first access of a block in buf_pool /** @return ut_time_ms() at the time of first access of a block in buf_pool
@retval 0 if not accessed */ @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 */ /** The buffer control block structure */
......
...@@ -100,23 +100,8 @@ inline bool buf_page_peek_if_too_old(const buf_page_t *bpage) ...@@ -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 statistics or move blocks in the LRU list. This is
either the warm-up phase or an in-memory workload. */ either the warm-up phase or an in-memory workload. */
return(FALSE); return(FALSE);
} else if (buf_LRU_old_threshold_ms && bpage->old) { } else if (bpage->old && buf_LRU_old_threshold_ms) {
uint32_t access_time = bpage->is_accessed(); return true;
/* 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 { } else {
return !buf_page_peek_if_young(bpage); return !buf_page_peek_if_young(bpage);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment