summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVadim Tkachenko <vadim@percona.com>2009-05-03 19:45:47 -0700
committerVadim Tkachenko <vadim@percona.com>2009-05-03 19:45:47 -0700
commit54b69cac0e5abd7d637d3fa4abc18216fc488bd1 (patch)
treed3bbf7e6070a239c249c66fcd3efada4358fa152 /include
parent8bda156a6a0893274cffcfd848cc8de6e60f7864 (diff)
downloadmariadb-git-54b69cac0e5abd7d637d3fa4abc18216fc488bd1.tar.gz
disable split_buffer_pool_mutex
Diffstat (limited to 'include')
-rw-r--r--include/buf0buddy.h6
-rw-r--r--include/buf0buddy.ic34
-rw-r--r--include/buf0buf.h14
-rw-r--r--include/buf0buf.ic69
-rw-r--r--include/buf0flu.ic9
-rw-r--r--include/buf0lru.h6
-rw-r--r--include/univ.i2
7 files changed, 45 insertions, 95 deletions
diff --git a/include/buf0buddy.h b/include/buf0buddy.h
index 2afef7913fc..f3e593151b5 100644
--- a/include/buf0buddy.h
+++ b/include/buf0buddy.h
@@ -49,11 +49,10 @@ buf_buddy_alloc(
/* out: allocated block,
possibly NULL if lru == NULL */
ulint size, /* in: block size, up to UNIV_PAGE_SIZE */
- ibool* lru, /* in: pointer to a variable that will be assigned
+ ibool* lru) /* in: pointer to a variable that will be assigned
TRUE if storage was allocated from the LRU list
and buf_pool_mutex was temporarily released,
or NULL if the LRU list should not be used */
- ibool have_page_hash_mutex)
__attribute__((malloc));
/**************************************************************************
@@ -64,8 +63,7 @@ buf_buddy_free(
/*===========*/
void* buf, /* in: block to be freed, must not be
pointed to by the buffer pool */
- ulint size, /* in: block size, up to UNIV_PAGE_SIZE */
- ibool have_page_hash_mutex)
+ ulint size) /* in: block size, up to UNIV_PAGE_SIZE */
__attribute__((nonnull));
/** Statistics of buddy blocks of a given size. */
diff --git a/include/buf0buddy.ic b/include/buf0buddy.ic
index 7d46b140449..769b9d11d94 100644
--- a/include/buf0buddy.ic
+++ b/include/buf0buddy.ic
@@ -44,11 +44,10 @@ buf_buddy_alloc_low(
possibly NULL if lru==NULL */
ulint i, /* in: index of buf_pool->zip_free[],
or BUF_BUDDY_SIZES */
- ibool* lru, /* in: pointer to a variable that will be assigned
+ ibool* lru) /* in: pointer to a variable that will be assigned
TRUE if storage was allocated from the LRU list
and buf_pool_mutex was temporarily released,
or NULL if the LRU list should not be used */
- ibool have_page_hash_mutex)
__attribute__((malloc));
/**************************************************************************
@@ -59,9 +58,8 @@ buf_buddy_free_low(
/*===============*/
void* buf, /* in: block to be freed, must not be
pointed to by the buffer pool */
- ulint i, /* in: index of buf_pool->zip_free[],
+ ulint i) /* in: index of buf_pool->zip_free[],
or BUF_BUDDY_SIZES */
- ibool have_page_hash_mutex)
__attribute__((nonnull));
/**************************************************************************
@@ -100,15 +98,14 @@ buf_buddy_alloc(
/* out: allocated block,
possibly NULL if lru == NULL */
ulint size, /* in: block size, up to UNIV_PAGE_SIZE */
- ibool* lru, /* in: pointer to a variable that will be assigned
+ ibool* lru) /* in: pointer to a variable that will be assigned
TRUE if storage was allocated from the LRU list
and buf_pool_mutex was temporarily released,
or NULL if the LRU list should not be used */
- ibool have_page_hash_mutex)
{
- //ut_ad(buf_pool_mutex_own());
+ ut_ad(buf_pool_mutex_own());
- return(buf_buddy_alloc_low(buf_buddy_get_slot(size), lru, have_page_hash_mutex));
+ return(buf_buddy_alloc_low(buf_buddy_get_slot(size), lru));
}
/**************************************************************************
@@ -119,26 +116,11 @@ buf_buddy_free(
/*===========*/
void* buf, /* in: block to be freed, must not be
pointed to by the buffer pool */
- ulint size, /* in: block size, up to UNIV_PAGE_SIZE */
- ibool have_page_hash_mutex)
+ ulint size) /* in: block size, up to UNIV_PAGE_SIZE */
{
- //ut_ad(buf_pool_mutex_own());
-
- if (!have_page_hash_mutex) {
- mutex_enter(&LRU_list_mutex);
- mutex_enter(&flush_list_mutex);
- rw_lock_x_lock(&page_hash_latch);
- }
-
- mutex_enter(&zip_free_mutex);
- buf_buddy_free_low(buf, buf_buddy_get_slot(size), TRUE);
- mutex_exit(&zip_free_mutex);
+ ut_ad(buf_pool_mutex_own());
- if (!have_page_hash_mutex) {
- mutex_exit(&LRU_list_mutex);
- mutex_exit(&flush_list_mutex);
- rw_lock_x_unlock(&page_hash_latch);
- }
+ buf_buddy_free_low(buf, buf_buddy_get_slot(size));
}
#ifdef UNIV_MATERIALIZE
diff --git a/include/buf0buf.h b/include/buf0buf.h
index 9f94f72e293..7a7b714aaaf 100644
--- a/include/buf0buf.h
+++ b/include/buf0buf.h
@@ -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
@@ -1104,11 +1104,11 @@ struct buf_block_struct{
a block is in the unzip_LRU list
if page.state == BUF_BLOCK_FILE_PAGE
and page.zip.data != NULL */
-//#ifdef UNIV_DEBUG
+#ifdef UNIV_DEBUG
ibool in_unzip_LRU_list;/* TRUE if the page is in the
decompressed LRU list;
used in debugging */
-//#endif /* UNIV_DEBUG */
+#endif /* UNIV_DEBUG */
byte* frame; /* pointer to buffer frame which
is of size UNIV_PAGE_SIZE, and
aligned to an address divisible by
@@ -1316,12 +1316,6 @@ struct buf_pool_struct{
/* mutex protecting the buffer pool struct and control blocks, except the
read-write lock in them */
extern mutex_t buf_pool_mutex;
-extern mutex_t LRU_list_mutex;
-extern mutex_t flush_list_mutex;
-extern rw_lock_t page_hash_latch;
-extern mutex_t free_list_mutex;
-extern mutex_t zip_free_mutex;
-extern mutex_t zip_hash_mutex;
/* mutex protecting the control blocks of compressed-only pages
(of type buf_page_t, not buf_block_t) */
extern mutex_t buf_pool_zip_mutex;
diff --git a/include/buf0buf.ic b/include/buf0buf.ic
index 3143ddd2f7c..a1dbfe2ebde 100644
--- a/include/buf0buf.ic
+++ b/include/buf0buf.ic
@@ -100,8 +100,7 @@ buf_pool_get_oldest_modification(void)
buf_page_t* bpage;
ib_uint64_t lsn;
- //buf_pool_mutex_enter();
- mutex_enter(&flush_list_mutex);
+ buf_pool_mutex_enter();
bpage = UT_LIST_GET_LAST(buf_pool->flush_list);
@@ -112,8 +111,7 @@ buf_pool_get_oldest_modification(void)
lsn = bpage->oldest_modification;
}
- //buf_pool_mutex_exit();
- mutex_exit(&flush_list_mutex);
+ buf_pool_mutex_exit();
/* The returned answer may be out of date: the flush_list can
change after the mutex has been released. */
@@ -130,8 +128,7 @@ buf_pool_clock_tic(void)
/*====================*/
/* out: new clock value */
{
- //ut_ad(buf_pool_mutex_own());
- ut_ad(mutex_own(&LRU_list_mutex));
+ ut_ad(buf_pool_mutex_own());
buf_pool->ulint_clock++;
@@ -249,7 +246,7 @@ buf_page_in_file(
case BUF_BLOCK_ZIP_FREE:
/* This is a free page in buf_pool->zip_free[].
Such pages should only be accessed by the buddy allocator. */
- /* ut_error; */ /* optimistic */
+ ut_error;
break;
case BUF_BLOCK_ZIP_PAGE:
case BUF_BLOCK_ZIP_DIRTY:
@@ -291,7 +288,7 @@ buf_page_get_LRU_position(
const buf_page_t* bpage) /* in: control block */
{
ut_ad(buf_page_in_file(bpage));
- //ut_ad(buf_pool_mutex_own()); /* This is used in optimistic */
+ ut_ad(buf_pool_mutex_own());
return(bpage->LRU_position);
}
@@ -308,7 +305,7 @@ buf_page_get_mutex(
{
switch (buf_page_get_state(bpage)) {
case BUF_BLOCK_ZIP_FREE:
- /* ut_error; */ /* optimistic */
+ ut_error;
return(NULL);
case BUF_BLOCK_ZIP_PAGE:
case BUF_BLOCK_ZIP_DIRTY:
@@ -413,7 +410,7 @@ buf_page_set_io_fix(
buf_page_t* bpage, /* in/out: control block */
enum buf_io_fix io_fix) /* in: io_fix state */
{
- //ut_ad(buf_pool_mutex_own());
+ ut_ad(buf_pool_mutex_own());
ut_ad(mutex_own(buf_page_get_mutex(bpage)));
bpage->io_fix = io_fix;
@@ -441,13 +438,12 @@ buf_page_can_relocate(
/*==================*/
const buf_page_t* bpage) /* control block being relocated */
{
- //ut_ad(buf_pool_mutex_own());
- /* optimistic */
- //ut_ad(mutex_own(buf_page_get_mutex(bpage)));
- //ut_ad(buf_page_in_file(bpage));
- //ut_ad(bpage->in_LRU_list);
+ ut_ad(buf_pool_mutex_own());
+ ut_ad(mutex_own(buf_page_get_mutex(bpage)));
+ ut_ad(buf_page_in_file(bpage));
+ ut_ad(bpage->in_LRU_list);
- return(bpage->in_LRU_list && bpage->io_fix == BUF_IO_NONE
+ return(buf_page_get_io_fix(bpage) == BUF_IO_NONE
&& bpage->buf_fix_count == 0);
}
@@ -461,7 +457,7 @@ buf_page_is_old(
const buf_page_t* bpage) /* in: control block */
{
ut_ad(buf_page_in_file(bpage));
- //ut_ad(buf_pool_mutex_own()); /* This is used in optimistic */
+ ut_ad(buf_pool_mutex_own());
return(bpage->old);
}
@@ -476,8 +472,7 @@ buf_page_set_old(
ibool old) /* in: old */
{
ut_a(buf_page_in_file(bpage));
- //ut_ad(buf_pool_mutex_own());
- ut_ad(mutex_own(&LRU_list_mutex));
+ ut_ad(buf_pool_mutex_own());
ut_ad(bpage->in_LRU_list);
#ifdef UNIV_LRU_DEBUG
@@ -733,17 +728,17 @@ buf_block_free(
/*===========*/
buf_block_t* block) /* in, own: block to be freed */
{
- //buf_pool_mutex_enter();
+ buf_pool_mutex_enter();
mutex_enter(&block->mutex);
ut_a(buf_block_get_state(block) != BUF_BLOCK_FILE_PAGE);
- buf_LRU_block_free_non_file_page(block, FALSE);
+ buf_LRU_block_free_non_file_page(block);
mutex_exit(&block->mutex);
- //buf_pool_mutex_exit();
+ buf_pool_mutex_exit();
}
/*************************************************************************
@@ -788,17 +783,14 @@ buf_page_io_query(
buf_page_t* bpage) /* in: buf_pool block, must be bufferfixed */
{
ibool io_fixed;
- mutex_t* block_mutex = buf_page_get_mutex(bpage);
- //buf_pool_mutex_enter();
- mutex_enter(block_mutex);
+ buf_pool_mutex_enter();
ut_ad(buf_page_in_file(bpage));
ut_ad(bpage->buf_fix_count > 0);
io_fixed = buf_page_get_io_fix(bpage) != BUF_IO_NONE;
- //buf_pool_mutex_exit();
- mutex_exit(block_mutex);
+ buf_pool_mutex_exit();
return(io_fixed);
}
@@ -925,11 +917,7 @@ buf_page_hash_get(
ulint fold;
ut_ad(buf_pool);
- //ut_ad(buf_pool_mutex_own());
-#ifdef UNIV_SYNC_DEBUG
- ut_ad(rw_lock_own(&page_hash_latch, RW_LOCK_EX)
- || rw_lock_own(&page_hash_latch, RW_LOCK_SHARED));
-#endif
+ ut_ad(buf_pool_mutex_own());
/* Look for the page in the hash table */
@@ -978,13 +966,11 @@ buf_page_peek(
{
const buf_page_t* bpage;
- //buf_pool_mutex_enter();
- rw_lock_s_lock(&page_hash_latch);
+ buf_pool_mutex_enter();
bpage = buf_page_hash_get(space, offset);
- //buf_pool_mutex_exit();
- rw_lock_s_unlock(&page_hash_latch);
+ buf_pool_mutex_exit();
return(bpage != NULL);
}
@@ -1047,17 +1033,12 @@ buf_page_release(
ut_a(block->page.buf_fix_count > 0);
if (rw_latch == RW_X_LATCH && mtr->modifications) {
- //buf_pool_mutex_enter();
- mutex_enter(&flush_list_mutex);
- mutex_enter(&block->mutex);
- ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
+ buf_pool_mutex_enter();
buf_flush_note_modification(block, mtr);
- //buf_pool_mutex_exit();
- mutex_exit(&flush_list_mutex);
+ buf_pool_mutex_exit();
}
- else {
+
mutex_enter(&block->mutex);
- }
#ifdef UNIV_SYNC_DEBUG
rw_lock_s_unlock(&(block->debug_latch));
diff --git a/include/buf0flu.ic b/include/buf0flu.ic
index 26fa7c02ef3..2dfa7e68d41 100644
--- a/include/buf0flu.ic
+++ b/include/buf0flu.ic
@@ -59,8 +59,7 @@ buf_flush_note_modification(
#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX));
#endif /* UNIV_SYNC_DEBUG */
- //ut_ad(buf_pool_mutex_own());
- ut_ad(mutex_own(&flush_list_mutex));
+ ut_ad(buf_pool_mutex_own());
ut_ad(mtr->start_lsn != 0);
ut_ad(mtr->modifications);
@@ -100,8 +99,7 @@ buf_flush_recv_note_modification(
ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX));
#endif /* UNIV_SYNC_DEBUG */
- //buf_pool_mutex_enter();
- mutex_enter(&flush_list_mutex);
+ buf_pool_mutex_enter();
ut_ad(block->page.newest_modification <= end_lsn);
@@ -118,6 +116,5 @@ buf_flush_recv_note_modification(
ut_ad(block->page.oldest_modification <= start_lsn);
}
- //buf_pool_mutex_exit();
- mutex_exit(&flush_list_mutex);
+ buf_pool_mutex_exit();
}
diff --git a/include/buf0lru.h b/include/buf0lru.h
index 3fd534a215d..e73869580bd 100644
--- a/include/buf0lru.h
+++ b/include/buf0lru.h
@@ -122,11 +122,10 @@ buf_LRU_free_block(
buf_page_t* bpage, /* in: block to be freed */
ibool zip, /* in: TRUE if should remove also the
compressed page of an uncompressed page */
- ibool* buf_pool_mutex_released,
+ ibool* buf_pool_mutex_released);
/* in: pointer to a variable that will
be assigned TRUE if buf_pool_mutex
was temporarily released, or NULL */
- ibool have_LRU_mutex);
/**********************************************************************
Try to free a replaceable block. */
UNIV_INTERN
@@ -170,8 +169,7 @@ UNIV_INTERN
void
buf_LRU_block_free_non_file_page(
/*=============================*/
- buf_block_t* block, /* in: block, must not contain a file page */
- ibool have_page_hash_mutex);
+ buf_block_t* block); /* in: block, must not contain a file page */
/**********************************************************************
Adds a block to the LRU list. */
UNIV_INTERN
diff --git a/include/univ.i b/include/univ.i
index d573fe664a7..27e82a5e07b 100644
--- a/include/univ.i
+++ b/include/univ.i
@@ -35,7 +35,7 @@ Created 1/20/1994 Heikki Tuuri
#define INNODB_VERSION_MAJOR 1
#define INNODB_VERSION_MINOR 0
#define INNODB_VERSION_BUGFIX 3
-#define PERCONA_INNODB_VERSION 5
+#define PERCONA_INNODB_VERSION 5a
/* The following is the InnoDB version as shown in
SELECT plugin_version FROM information_schema.plugins;