• marko's avatar
    branches/zip: Improve the LRU algorithm with a separate unzip_LRU list of · 7c119c95
    marko authored
    blocks that contains uncompressed and compressed frames.  This patch was
    designed by Heikki and Inaam, implemented by Inaam, and refined and reviewed
    by Marko and Sunny.
    
    buf_buddy_n_frames, buf_buddy_min_n_frames, buf_buddy_max_n_frames: Remove.
    
    buf_page_belongs_to_unzip_LRU(): New predicate:
    bpage->zip.data && buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE.
    
    buf_pool_t, buf_block_t: Add the linked list unzip_LRU.  A block in the
    regular LRU list is in unzip_LRU iff buf_page_belongs_to_unzip_LRU() holds.
    
    buf_LRU_free_block(): Add a third return value to refine the case
    "cannot free the block".
    
    buf_LRU_search_and_free_block(): Update the documentation to reflect the
    implementation.
    
    buf_LRU_stat_t, buf_LRU_stat_cur, buf_LRU_stat_sum, buf_LRU_stat_arr[]:
    Statistics for the unzip_LRU algorithm.
    
    buf_LRU_stat_update(): New function: Update the statistics.  Called once
    per second by srv_error_monitor_thread().
    
    buf_LRU_validate(): Validate the unzip_LRU list as well.
    
    buf_LRU_evict_from_unzip_LRU(): New predicate: Use the unzip_LRU before
    falling back to the regular LRU?
    
    buf_LRU_free_from_unzip_LRU_list(), buf_LRU_free_from_common_LRU_list():
    Subfunctions of buf_LRU_search_and_free_block().
    
    buf_LRU_search_and_free_block(): Reimplement.  Try to evict an uncompressed
    page from the unzip_LRU list before falling back to evicting an entire block
    from the common LRU list.
    
    buf_unzip_LRU_remove_block_if_needed(): New function.
    
    buf_unzip_LRU_add_block(): New function: Add a block to the unzip_LRU list.
    7c119c95
buf0lru.h 8.71 KB