Commit f4ae92b2 authored by Vadim Tkachenko's avatar Vadim Tkachenko

sync rev 59

parent 42f4cb6c
......@@ -138,7 +138,7 @@ buf_buddy_alloc_zip(
/* Valgrind would complain about accessing free memory. */
UT_LIST_VALIDATE(list, buf_page_t, buf_pool->zip_free[i]);
#endif /* UNIV_DEBUG && !UNIV_DEBUG_VALGRIND */
bpage = UT_LIST_GET_FIRST(buf_pool->zip_free[i]);
bpage = UT_LIST_GET_LAST(buf_pool->zip_free[i]);
if (bpage) {
UNIV_MEM_VALID(bpage, BUF_BUDDY_LOW << i);
......
......@@ -664,9 +664,9 @@ buf_block_init(
block->page.in_zip_hash = FALSE;
block->page.in_flush_list = FALSE;
block->page.in_free_list = FALSE;
block->page.in_LRU_list = FALSE;
block->in_unzip_LRU_list = FALSE;
#endif /* UNIV_DEBUG */
block->page.in_LRU_list = FALSE;
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
block->n_pointers = 0;
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
......@@ -1130,7 +1130,7 @@ buf_relocate(
memcpy(dpage, bpage, sizeof *dpage);
ut_d(bpage->in_LRU_list = FALSE);
bpage->in_LRU_list = FALSE;
ut_d(bpage->in_page_hash = FALSE);
/* relocate buf_pool->LRU */
......@@ -2870,8 +2870,8 @@ err_exit:
bpage->in_zip_hash = FALSE;
bpage->in_flush_list = FALSE;
bpage->in_free_list = FALSE;
bpage->in_LRU_list = FALSE;
#endif /* UNIV_DEBUG */
bpage->in_LRU_list = FALSE;
ut_d(bpage->in_page_hash = TRUE);
HASH_INSERT(buf_page_t, hash, buf_pool->page_hash,
......@@ -3729,7 +3729,7 @@ buf_get_modified_ratio_pct(void)
{
ulint ratio;
buf_pool_mutex_enter();
//buf_pool_mutex_enter(); /* optimistic */
ratio = (100 * UT_LIST_GET_LEN(buf_pool->flush_list))
/ (1 + UT_LIST_GET_LEN(buf_pool->LRU)
......@@ -3737,7 +3737,7 @@ buf_get_modified_ratio_pct(void)
/* 1 + is there to avoid division by zero */
buf_pool_mutex_exit();
//buf_pool_mutex_exit(); /* optimistic */
return(ratio);
}
......
......@@ -134,10 +134,10 @@ buf_flush_ready_for_replace(
buf_page_in_file(bpage) and in the LRU list */
{
//ut_ad(buf_pool_mutex_own());
ut_ad(mutex_own(buf_page_get_mutex(bpage)));
//ut_ad(mutex_own(buf_page_get_mutex(bpage)));
//ut_ad(bpage->in_LRU_list); /* optimistic use */
if (UNIV_LIKELY(buf_page_in_file(bpage))) {
if (UNIV_LIKELY(bpage->in_LRU_list && buf_page_in_file(bpage))) {
return(bpage->oldest_modification == 0
&& buf_page_get_io_fix(bpage) == BUF_IO_NONE
......@@ -1147,8 +1147,14 @@ buf_flush_LRU_recommendation(void)
buf_page_t* bpage;
ulint n_replaceable;
ulint distance = 0;
ibool have_LRU_mutex = FALSE;
if(UT_LIST_GET_LEN(buf_pool->unzip_LRU))
have_LRU_mutex = TRUE;
//buf_pool_mutex_enter();
if (have_LRU_mutex)
buf_pool_mutex_enter();
n_replaceable = UT_LIST_GET_LEN(buf_pool->free);
......@@ -1159,6 +1165,12 @@ buf_flush_LRU_recommendation(void)
+ BUF_FLUSH_EXTRA_MARGIN)
&& (distance < BUF_LRU_FREE_SEARCH_LEN)) {
if (!bpage->in_LRU_list) {
/* reatart. but it is very optimistic */
bpage = UT_LIST_GET_LAST(buf_pool->LRU);
continue;
}
mutex_t* block_mutex = buf_page_get_mutex(bpage);
mutex_enter(block_mutex);
......@@ -1175,6 +1187,8 @@ buf_flush_LRU_recommendation(void)
}
//buf_pool_mutex_exit();
if (have_LRU_mutex)
buf_pool_mutex_exit();
if (n_replaceable >= BUF_FLUSH_FREE_BLOCK_MARGIN) {
......
......@@ -1090,7 +1090,7 @@ buf_LRU_remove_block(
/* Remove the block from the LRU list */
UT_LIST_REMOVE(LRU, buf_pool->LRU, bpage);
ut_d(bpage->in_LRU_list = FALSE);
bpage->in_LRU_list = FALSE;
buf_unzip_LRU_remove_block_if_needed(bpage);
......@@ -1166,7 +1166,7 @@ buf_LRU_add_block_to_end_low(
ut_ad(!bpage->in_LRU_list);
UT_LIST_ADD_LAST(LRU, buf_pool->LRU, bpage);
ut_d(bpage->in_LRU_list = TRUE);
bpage->in_LRU_list = TRUE;
buf_page_set_old(bpage, TRUE);
......@@ -1243,7 +1243,7 @@ buf_LRU_add_block_low(
bpage->LRU_position = (buf_pool->LRU_old)->LRU_position;
}
ut_d(bpage->in_LRU_list = TRUE);
bpage->in_LRU_list = TRUE;
buf_page_set_old(bpage, old);
......@@ -1478,7 +1478,7 @@ alloc:
buf_LRU_old_init();
}
} else {
ut_d(b->in_LRU_list = FALSE);
b->in_LRU_list = FALSE;
buf_LRU_add_block_low(b, buf_page_is_old(b));
}
......
......@@ -1061,10 +1061,10 @@ struct buf_page_struct{
UT_LIST_NODE_T(buf_page_t) LRU;
/* node of the LRU list */
#ifdef UNIV_DEBUG
//#ifdef UNIV_DEBUG
ibool in_LRU_list; /* TRUE if the page is in the LRU list;
used in debugging */
#endif /* UNIV_DEBUG */
//#endif /* UNIV_DEBUG */
unsigned old:1; /* TRUE if the block is in the old
blocks in the LRU list */
unsigned LRU_position:31;/* value which monotonically decreases
......
......@@ -74,3 +74,51 @@
KEY_COLUMN_USAGE information_schema.KEY_COLUMN_USAGE 1
PARTITIONS information_schema.PARTITIONS 1
PLUGINS information_schema.PLUGINS 1
diff mysql-test/r/information_schema_db.result.orig mysql-test/r/information_schema_db.result
--- mysql-test/r/information_schema_db.result.orig 2008-08-04 09:27:49.000000000 +0300
+++ mysql-test/r/information_schema_db.result 2008-10-07 12:26:31.000000000 +0300
@@ -33,6 +33,13 @@
TRIGGERS
USER_PRIVILEGES
VIEWS
+INNODB_CMP_RESET
+INNODB_TRX
+INNODB_CMPMEM_RESET
+INNODB_LOCK_WAITS
+INNODB_CMPMEM
+INNODB_CMP
+INNODB_LOCKS
show tables from INFORMATION_SCHEMA like 'T%';
Tables_in_information_schema (T%)
TABLES
diff mysql-test/r/mysqlshow.result.orig mysql-test/r/mysqlshow.result
--- mysql-test/r/mysqlshow.result.orig 2008-08-04 09:27:51.000000000 +0300
+++ mysql-test/r/mysqlshow.result 2008-10-07 12:35:39.000000000 +0300
@@ -107,6 +107,13 @@
| TRIGGERS |
| USER_PRIVILEGES |
| VIEWS |
+| INNODB_CMP_RESET |
+| INNODB_TRX |
+| INNODB_CMPMEM_RESET |
+| INNODB_LOCK_WAITS |
+| INNODB_CMPMEM |
+| INNODB_CMP |
+| INNODB_LOCKS |
+---------------------------------------+
Database: INFORMATION_SCHEMA
+---------------------------------------+
@@ -140,6 +147,13 @@
| TRIGGERS |
| USER_PRIVILEGES |
| VIEWS |
+| INNODB_CMP_RESET |
+| INNODB_TRX |
+| INNODB_CMPMEM_RESET |
+| INNODB_LOCK_WAITS |
+| INNODB_CMPMEM |
+| INNODB_CMP |
+| INNODB_LOCKS |
+---------------------------------------+
Wildcard: inf_rmation_schema
+--------------------+
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