Commit 051ee491 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 53b86f0d
......@@ -30,10 +30,15 @@ Protected by buf_pool->mutex. */
ib_uint64_t buf_buddy_relocated[BUF_BUDDY_SIZES + 1];
/** Preferred minimum number of frames allocated from the buffer pool
to the buddy system. When this number is exceeded, the buddy allocator
will not try to free clean compressed-only pages in order to satisfy
an allocation request. Protected by buf_pool->mutex. */
ulint buf_buddy_min_n_frames = ULINT_UNDEFINED;
to the buddy system. Unless this number is exceeded or the buffer
pool is scarce, the LRU algorithm will not free compressed-only pages
in order to satisfy an allocation request. Protected by buf_pool->mutex. */
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. */
......@@ -278,7 +283,7 @@ buf_buddy_alloc_clean(
ut_ad(mutex_own(&buf_pool->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;
}
......
......@@ -54,10 +54,15 @@ buf_buddy_free(
Protected by buf_pool->mutex. */
extern ulint buf_buddy_n_frames;
/** Preferred minimum number of frames allocated from the buffer pool
to the buddy system. When this number is exceeded, the buddy allocator
will not try to free clean compressed-only pages in order to satisfy
an allocation request. Protected by buf_pool->mutex. */
to the buddy system. Unless this number is exceeded or the buffer
pool is scarce, the LRU algorithm will not free compressed-only pages
in order to satisfy an allocation request. Protected by buf_pool->mutex. */
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.
Protected by buf_pool->mutex. */
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