summaryrefslogtreecommitdiff
path: root/innobase/buf/buf0lru.c
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.fi>2001-10-30 17:38:44 +0200
committerunknown <monty@donna.mysql.fi>2001-10-30 17:38:44 +0200
commit7b24c57c56b150132f0c4b541ef23a20f8f74ace (patch)
tree097886eb981160413975cb915243d4ae60718154 /innobase/buf/buf0lru.c
parentfed395c75224ee11c1cd53fc24285e8575c6bec8 (diff)
downloadmariadb-git-7b24c57c56b150132f0c4b541ef23a20f8f74ace.tar.gz
Merge
include/my_base.h: Try again merge InnoDB-3.23.44 include/mysqld_error.h: Try again merge InnoDB-3.23.44 sql/handler.cc: Try again merge InnoDB-3.23.44 sql/mysqld.cc: Try again merge InnoDB-3.23.44 sql/ha_innobase.cc: Try again merge InnoDB-3.23.44 sql/ha_innobase.h: Try again merge InnoDB-3.23.44 sql/share/czech/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/danish/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/dutch/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/english/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/estonian/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/french/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/german/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/greek/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/hungarian/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/italian/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/japanese/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/korean/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/norwegian-ny/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/norwegian/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/polish/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/portuguese/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/romanian/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/russian/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/slovak/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/spanish/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/swedish/errmsg.txt: Try again merge InnoDB-3.23.44 sql/share/ukrainian/errmsg.txt: Try again merge InnoDB-3.23.44 innobase/btr/btr0btr.c: Try again merge InnoDB-3.23.44 innobase/buf/buf0flu.c: Try again merge InnoDB-3.23.44 innobase/buf/buf0lru.c: Try again merge InnoDB-3.23.44 innobase/dict/dict0boot.c: Try again merge InnoDB-3.23.44 innobase/dict/dict0crea.c: Try again merge InnoDB-3.23.44 innobase/dict/dict0dict.c: Try again merge InnoDB-3.23.44 innobase/ibuf/ibuf0ibuf.c: Try again merge InnoDB-3.23.44 innobase/include/dict0boot.h: Try again merge InnoDB-3.23.44 innobase/include/dict0boot.ic: Try again merge InnoDB-3.23.44 innobase/include/dict0dict.h: Try again merge InnoDB-3.23.44 innobase/include/os0file.h: Try again merge InnoDB-3.23.44 innobase/include/os0sync.h: Try again merge InnoDB-3.23.44 innobase/include/page0page.ic: Try again merge InnoDB-3.23.44 innobase/include/read0read.h: Try again merge InnoDB-3.23.44 innobase/include/row0mysql.h: Try again merge InnoDB-3.23.44 innobase/include/srv0srv.h: Try again merge InnoDB-3.23.44 innobase/include/srv0start.h: Try again merge InnoDB-3.23.44 innobase/include/trx0purge.h: Try again merge InnoDB-3.23.44 innobase/include/trx0rec.h: Try again merge InnoDB-3.23.44 innobase/include/trx0trx.h: Try again merge InnoDB-3.23.44 innobase/lock/lock0lock.c: Try again merge InnoDB-3.23.44 innobase/log/log0log.c: Try again merge InnoDB-3.23.44 innobase/log/log0recv.c: Try again merge InnoDB-3.23.44 innobase/os/os0file.c: Try again merge InnoDB-3.23.44 innobase/page/page0page.c: Try again merge InnoDB-3.23.44 innobase/read/read0read.c: Try again merge InnoDB-3.23.44 innobase/rem/rem0cmp.c: Try again merge InnoDB-3.23.44 innobase/rem/rem0rec.c: Try again merge InnoDB-3.23.44 innobase/row/row0ins.c: Try again merge InnoDB-3.23.44 innobase/row/row0mysql.c: Try again merge InnoDB-3.23.44 innobase/row/row0purge.c: Try again merge InnoDB-3.23.44 innobase/row/row0row.c: Try again merge InnoDB-3.23.44 innobase/row/row0sel.c: Try again merge InnoDB-3.23.44 innobase/row/row0umod.c: Try again merge InnoDB-3.23.44 innobase/row/row0upd.c: Try again merge InnoDB-3.23.44 innobase/row/row0vers.c: Try again merge InnoDB-3.23.44 innobase/srv/srv0start.c: Try again merge InnoDB-3.23.44 innobase/sync/sync0arr.c: Try again merge InnoDB-3.23.44 innobase/trx/trx0purge.c: Try again merge InnoDB-3.23.44 innobase/trx/trx0rec.c: Try again merge InnoDB-3.23.44 innobase/trx/trx0roll.c: Try again merge InnoDB-3.23.44 innobase/trx/trx0sys.c: Try again merge InnoDB-3.23.44 innobase/trx/trx0trx.c: Try again merge InnoDB-3.23.44 innobase/trx/trx0undo.c: Try again merge InnoDB-3.23.44 innobase/srv/srv0srv.c: Commit change made by heikki BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'innobase/buf/buf0lru.c')
-rw-r--r--innobase/buf/buf0lru.c67
1 files changed, 42 insertions, 25 deletions
diff --git a/innobase/buf/buf0lru.c b/innobase/buf/buf0lru.c
index eb63fa99f4a..82777e4ef2f 100644
--- a/innobase/buf/buf0lru.c
+++ b/innobase/buf/buf0lru.c
@@ -107,20 +107,15 @@ buf_LRU_search_and_free_block(
means that we should search farther */
{
buf_block_t* block;
- ulint distance;
ibool freed;
- ulint i;
mutex_enter(&(buf_pool->mutex));
freed = FALSE;
- distance = BUF_LRU_FREE_SEARCH_LEN * (1 + n_iterations / 5);
-
- i = 0;
block = UT_LIST_GET_LAST(buf_pool->LRU);
- while (i < distance && block != NULL) {
+ while (block != NULL) {
if (buf_flush_ready_for_replace(block)) {
@@ -203,6 +198,8 @@ buf_LRU_get_free_block(void)
buf_block_t* block = NULL;
ibool freed;
ulint n_iterations = 0;
+ ibool mon_value_was;
+ ibool started_monitor = FALSE;
loop:
mutex_enter(&(buf_pool->mutex));
@@ -222,7 +219,11 @@ loop:
block->state = BUF_BLOCK_READY_FOR_USE;
mutex_exit(&(buf_pool->mutex));
-
+
+ if (started_monitor) {
+ srv_print_innodb_monitor = mon_value_was;
+ }
+
return(block);
}
@@ -237,14 +238,41 @@ loop:
goto loop;
}
- /* No free block was found near the end of the list: try to flush
- the LRU list */
-
- buf_flush_free_margin();
+ if (n_iterations > 30) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " ***********************************************\n"
+ "InnoDB: Warning: difficult to find free blocks from\n"
+ "InnoDB: the buffer pool (%lu search iterations)! Consider\n"
+ "InnoDB: increasing the buffer pool size.\n",
+ n_iterations);
+ fprintf(stderr,
+ "InnoDB: It is also possible that in your Unix version\n"
+ "InnoDB: fsync is very slow, or completely frozen inside\n"
+ "InnoDB: the OS kernel. Then upgrading to a newer version\n"
+ "InnoDB: of your operating system may help. Look at the\n"
+ "InnoDB: number of fsyncs in diagnostic info below.\n");
+
+ fprintf(stderr,
+ "InnoDB: Pending flushes (fsync) log: %lu; buffer pool: %lu\n",
+ fil_n_pending_log_flushes,
+ fil_n_pending_tablespace_flushes);
+ fprintf(stderr,
+ "InnoDB: %lu OS file reads, %lu OS file writes, %lu OS fsyncs\n",
+ os_n_file_reads, os_n_file_writes, os_n_fsyncs);
+
+ fprintf(stderr,
+ "InnoDB: Starting InnoDB Monitor to print further\n"
+ "InnoDB: diagnostics to the standard output.\n");
+
+ mon_value_was = srv_print_innodb_monitor;
+ started_monitor = TRUE;
+ srv_print_innodb_monitor = TRUE;
+ }
- os_event_wait(buf_pool->no_flush[BUF_FLUSH_LRU]);
+ /* No free block was found: try to flush the LRU list */
- n_iterations++;
+ buf_flush_free_margin();
os_aio_simulated_wake_handler_threads();
@@ -253,18 +281,7 @@ loop:
os_thread_sleep(500000);
}
- if (n_iterations > 20) {
-/* buf_print();
- os_aio_print();
- rw_lock_list_print_info();
-*/
- if (n_iterations > 30) {
- fprintf(stderr,
- "InnoDB: Warning: difficult to find free blocks from\n"
- "InnoDB: the buffer pool (%lu search iterations)! Consider\n"
- "InnoDB: increasing the buffer pool size.\n", n_iterations);
- }
- }
+ n_iterations++;
goto loop;
}