Commit b0567456 authored by marko's avatar marko

branches/zip: Split the source-only configuration parameter

buf_buddy_min_n_frames into two, also buf_buddy_max_n_frames.
Set the default values in such a way that a strict LRU policy will apply
for replacing compressed or uncompressed page frames in the buffer pool.

These parameters have not yet been exposed to the MySQL layer.
parent 02819f3e
...@@ -30,10 +30,15 @@ Protected by buf_pool->mutex. */ ...@@ -30,10 +30,15 @@ Protected by buf_pool->mutex. */
ib_uint64_t buf_buddy_relocated[BUF_BUDDY_SIZES + 1]; ib_uint64_t buf_buddy_relocated[BUF_BUDDY_SIZES + 1];
/** Preferred minimum number of frames allocated from the buffer pool /** Preferred minimum number of frames allocated from the buffer pool
to the buddy system. When this number is exceeded, the buddy allocator to the buddy system. Unless this number is exceeded or the buffer
will not try to free clean compressed-only pages in order to satisfy pool is scarce, the LRU algorithm will not free compressed-only pages
an allocation request. Protected by buf_pool->mutex. */ in order to satisfy an allocation request. Protected by buf_pool->mutex. */
ulint buf_buddy_min_n_frames = ULINT_UNDEFINED; ulint buf_buddy_min_n_frames = 0;
/** Preferred maximum number of frames allocated from the buffer pool
to the buddy system. Unless this number is exceeded, the buddy allocator
will not try to free clean compressed-only pages before falling back
to the LRU algorithm. Protected by buf_pool->mutex. */
ulint buf_buddy_max_n_frames = ULINT_UNDEFINED;
/************************************************************************** /**************************************************************************
Get the offset of the buddy of a compressed page frame. */ Get the offset of the buddy of a compressed page frame. */
...@@ -278,7 +283,7 @@ buf_buddy_alloc_clean( ...@@ -278,7 +283,7 @@ buf_buddy_alloc_clean(
ut_ad(mutex_own(&buf_pool->mutex)); ut_ad(mutex_own(&buf_pool->mutex));
ut_ad(!mutex_own(&buf_pool->zip_mutex)); ut_ad(!mutex_own(&buf_pool->zip_mutex));
if (buf_buddy_n_frames > buf_buddy_min_n_frames) { if (buf_buddy_n_frames < buf_buddy_max_n_frames) {
goto free_LRU; goto free_LRU;
} }
......
...@@ -54,10 +54,15 @@ buf_buddy_free( ...@@ -54,10 +54,15 @@ buf_buddy_free(
Protected by buf_pool->mutex. */ Protected by buf_pool->mutex. */
extern ulint buf_buddy_n_frames; extern ulint buf_buddy_n_frames;
/** Preferred minimum number of frames allocated from the buffer pool /** Preferred minimum number of frames allocated from the buffer pool
to the buddy system. When this number is exceeded, the buddy allocator to the buddy system. Unless this number is exceeded or the buffer
will not try to free clean compressed-only pages in order to satisfy pool is scarce, the LRU algorithm will not free compressed-only pages
an allocation request. Protected by buf_pool->mutex. */ in order to satisfy an allocation request. Protected by buf_pool->mutex. */
extern ulint buf_buddy_min_n_frames; extern ulint buf_buddy_min_n_frames;
/** Preferred maximum number of frames allocated from the buffer pool
to the buddy system. Unless this number is exceeded, the buddy allocator
will not try to free clean compressed-only pages before falling back
to the LRU algorithm. Protected by buf_pool->mutex. */
extern ulint buf_buddy_max_n_frames;
/** Counts of blocks allocated from the buddy system. /** Counts of blocks allocated from the buddy system.
Protected by buf_pool->mutex. */ Protected by buf_pool->mutex. */
extern ulint buf_buddy_used[BUF_BUDDY_SIZES + 1]; extern ulint buf_buddy_used[BUF_BUDDY_SIZES + 1];
......
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