buf_LRU_make_block_old(buf_page_t*bpage)
buf_LRU_remove_block(bpage);
buf_LRU_add_block_to_end_low(bpage);//添加到尾部
//该函数在MySQL5.6.33中貌似没有调用了
1、page被第一次读入bufpool时,会加入LRU list,并设置为old。当LRU链表长度小于512时,不区分young和old
//old参数为TRUE,加入LRU old的头部
buf_read_page_low-> buf_page_init_for_read-> buf_LRU_add_block(bpage, TRUE);
if(LRU list<512){
UT_LIST_ADD_FIRST(LRU, buf_pool->LRU, bpage);
}else{
UT_LIST_INSERT_AFTER(LRU, buf_pool->LRU, buf_pool->LRU_old,bpage);
}
…
2、buf_LRU_make_block_young将page从LRU中删除,然后插入到head,那么young的page会慢慢变成old
buf_LRU_add_block_low(bpage, FALSE);
//在链表>=512时,每次都会调整
buf_LRU_old_adjust_len(buf_pool);->
buf_pool->LRU_old = LRU_old = UT_LIST_GET_PREV(LRU, LRU_old);
buf_page_set_old(LRU_old, TRUE);