Commit b4924e24 authored by Vadim Tkachenko's avatar Vadim Tkachenko

Sync optimistic_margine_count

parent b89957b3
......@@ -2850,7 +2850,7 @@ buf_page_create(
ibuf_merge_or_delete_for_page(NULL, space, offset, zip_size, TRUE);
/* Flush pages from the end of the LRU list if necessary */
buf_flush_free_margin();
buf_flush_free_margin(FALSE);
frame = block->frame;
......
......@@ -151,7 +151,7 @@ buf_flush_ready_for_replace(
buf_page_t* bpage) /* in: buffer control block, must be
buf_page_in_file(bpage) and in the LRU list */
{
ut_ad(buf_pool_mutex_own());
//ut_ad(buf_pool_mutex_own());
ut_ad(mutex_own(buf_page_get_mutex(bpage)));
ut_ad(bpage->in_LRU_list);
......@@ -162,6 +162,8 @@ buf_flush_ready_for_replace(
&& bpage->buf_fix_count == 0);
}
/* permited not to own LRU_mutex.. */
/*
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error: buffer block state %lu"
......@@ -169,6 +171,7 @@ buf_flush_ready_for_replace(
(ulong) buf_page_get_state(bpage));
ut_print_buf(stderr, bpage, sizeof(buf_page_t));
putc('\n', stderr);
*/
return(FALSE);
}
......@@ -1190,7 +1193,7 @@ buf_flush_LRU_recommendation(void)
ulint n_replaceable;
ulint distance = 0;
buf_pool_mutex_enter();
//buf_pool_mutex_enter();
n_replaceable = UT_LIST_GET_LEN(buf_pool->free);
......@@ -1216,7 +1219,7 @@ buf_flush_LRU_recommendation(void)
bpage = UT_LIST_GET_PREV(LRU, bpage);
}
buf_pool_mutex_exit();
//buf_pool_mutex_exit();
if (n_replaceable >= BUF_FLUSH_FREE_BLOCK_MARGIN) {
......@@ -1235,8 +1238,9 @@ flush only pages such that the s-lock required for flushing can be acquired
immediately, without waiting. */
UNIV_INTERN
void
buf_flush_free_margin(void)
buf_flush_free_margin(
/*=======================*/
ibool wait)
{
ulint n_to_flush;
ulint n_flushed;
......@@ -1245,7 +1249,7 @@ buf_flush_free_margin(void)
if (n_to_flush > 0) {
n_flushed = buf_flush_batch(BUF_FLUSH_LRU, n_to_flush, 0);
if (n_flushed == ULINT_UNDEFINED) {
if (wait && n_flushed == ULINT_UNDEFINED) {
/* There was an LRU type flush batch already running;
let us wait for it to end */
......
......@@ -885,7 +885,7 @@ loop:
/* No free block was found: try to flush the LRU list */
buf_flush_free_margin();
buf_flush_free_margin(TRUE);
++srv_buf_pool_wait_free;
os_aio_simulated_wake_handler_threads();
......
......@@ -358,7 +358,7 @@ buf_read_page(
}
/* Flush pages from the end of the LRU list if necessary */
buf_flush_free_margin();
buf_flush_free_margin(FALSE);
/* Increment number of I/O operations used for LRU policy. */
buf_LRU_stat_inc_io();
......@@ -619,7 +619,7 @@ buf_read_ahead_linear(
os_aio_simulated_wake_handler_threads();
/* Flush pages from the end of the LRU list if necessary */
buf_flush_free_margin();
buf_flush_free_margin(FALSE);
#ifdef UNIV_DEBUG
if (buf_debug_prints && (count > 0)) {
......@@ -704,7 +704,7 @@ tablespace_deleted:
os_aio_simulated_wake_handler_threads();
/* Flush pages from the end of the LRU list if necessary */
buf_flush_free_margin();
buf_flush_free_margin(FALSE);
#ifdef UNIV_DEBUG
if (buf_debug_prints) {
......@@ -789,7 +789,7 @@ buf_read_recv_pages(
os_aio_simulated_wake_handler_threads();
/* Flush pages from the end of the LRU list if necessary */
buf_flush_free_margin();
buf_flush_free_margin(FALSE);
#ifdef UNIV_DEBUG
if (buf_debug_prints) {
......
......@@ -27,5 +27,6 @@ struct innodb_enhancement {
{"innodb_show_status","Improvements to SHOW INNODB STATUS","Memory information and lock info fixes","http://www.percona.com/docs/wiki/percona-innodb-plugin:innodb_show_status"},
{"innodb_io","Improvements to InnoDB IO","","http://www.percona.com/docs/wiki/percona-innodb-plugin:innodb_io"},
{"innodb_rw_lock","InnoDB RW-lock fixes","Useful for 8+ cores SMP systems","http://www.percona.com/docs/wiki/percona-innodb-plugin:innodb_rw_lock"},
{"optimistic_margine_count","Fix of buffer_pool mutex","Decreases contention on buffer_pool mutex","http://www.percona.com/docs/wiki/percona-innodb-plugin:optimistic_margine_count"},
{NULL, NULL, NULL, NULL}
};
......@@ -40,8 +40,9 @@ Flushes pages from the end of the LRU list if there is too small
a margin of replaceable pages there. */
UNIV_INTERN
void
buf_flush_free_margin(void);
buf_flush_free_margin(
/*=======================*/
ibool wait);
/************************************************************************
Initializes a page for writing to the tablespace. */
UNIV_INTERN
......
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