summaryrefslogtreecommitdiff
path: root/storage/xtradb/buf
diff options
context:
space:
mode:
Diffstat (limited to 'storage/xtradb/buf')
-rw-r--r--storage/xtradb/buf/buf0buf.cc11
-rw-r--r--storage/xtradb/buf/buf0flu.cc6
-rw-r--r--storage/xtradb/buf/buf0lru.cc2
-rw-r--r--storage/xtradb/buf/buf0rea.cc8
4 files changed, 12 insertions, 15 deletions
diff --git a/storage/xtradb/buf/buf0buf.cc b/storage/xtradb/buf/buf0buf.cc
index 6c6b67ad774..97781a12d20 100644
--- a/storage/xtradb/buf/buf0buf.cc
+++ b/storage/xtradb/buf/buf0buf.cc
@@ -295,7 +295,6 @@ UNIV_INTERN mysql_pfs_key_t buf_block_debug_latch_key;
#ifdef UNIV_PFS_MUTEX
UNIV_INTERN mysql_pfs_key_t buffer_block_mutex_key;
-UNIV_INTERN mysql_pfs_key_t buf_pool_mutex_key;
UNIV_INTERN mysql_pfs_key_t buf_pool_zip_mutex_key;
UNIV_INTERN mysql_pfs_key_t buf_pool_flush_state_mutex_key;
UNIV_INTERN mysql_pfs_key_t buf_pool_LRU_list_mutex_key;
@@ -1783,16 +1782,12 @@ page_found:
ut_ad(!bpage->in_page_hash);
ut_ad(bpage->buf_fix_count == 0);
- mutex_enter(&buf_pool->zip_mutex);
-
bpage->state = BUF_BLOCK_ZIP_PAGE;
bpage->space = static_cast<ib_uint32_t>(space);
bpage->offset = static_cast<ib_uint32_t>(offset);
bpage->buf_fix_count = 1;
bpage->buf_pool_index = buf_pool_index(buf_pool);
- mutex_exit(&buf_pool->zip_mutex);
-
ut_d(bpage->in_page_hash = TRUE);
HASH_INSERT(buf_page_t, hash, buf_pool->page_hash,
fold, bpage);
@@ -1844,7 +1839,6 @@ buf_pool_watch_remove(
#endif /* UNIV_SYNC_DEBUG */
ut_ad(buf_page_get_state(watch) == BUF_BLOCK_ZIP_PAGE);
- ut_ad(buf_own_zip_mutex_for_page(watch));
HASH_DELETE(buf_page_t, hash, buf_pool->page_hash, fold, watch);
ut_d(watch->in_page_hash = FALSE);
@@ -1887,9 +1881,7 @@ buf_pool_watch_unset(
#endif /* PAGE_ATOMIC_REF_COUNT */
if (bpage->buf_fix_count == 0) {
- mutex_enter(&buf_pool->zip_mutex);
buf_pool_watch_remove(buf_pool, fold, bpage);
- mutex_exit(&buf_pool->zip_mutex);
}
}
@@ -4474,7 +4466,7 @@ corrupt:
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
buf_page_get_flush_type(bpage) == BUF_FLUSH_LRU)) {
- have_LRU_mutex = TRUE; /* optimistic */
+ have_LRU_mutex = true; /* optimistic */
}
retry_mutex:
if (have_LRU_mutex) {
@@ -4494,6 +4486,7 @@ retry_mutex:
&& !have_LRU_mutex) {
mutex_exit(block_mutex);
+ have_LRU_mutex = true;
goto retry_mutex;
}
diff --git a/storage/xtradb/buf/buf0flu.cc b/storage/xtradb/buf/buf0flu.cc
index 5dabf3b77e7..7c9e5e091c5 100644
--- a/storage/xtradb/buf/buf0flu.cc
+++ b/storage/xtradb/buf/buf0flu.cc
@@ -1107,8 +1107,8 @@ buf_flush_page(
# if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
/********************************************************************//**
Writes a flushable page asynchronously from the buffer pool to a file.
-NOTE: block->mutex must be held upon entering this function, and it will be
-released by this function after flushing. This is loosely based on
+NOTE: block and LRU list mutexes must be held upon entering this function, and
+they will be released by this function after flushing. This is loosely based on
buf_flush_batch() and buf_flush_page().
@return TRUE if the page was flushed and the mutexes released */
UNIV_INTERN
@@ -1659,6 +1659,8 @@ buf_do_LRU_batch(
flush_counters_t* n) /*!< out: flushed/evicted page
counts */
{
+ ut_ad(mutex_own(&buf_pool->LRU_list_mutex));
+
if (buf_LRU_evict_from_unzip_LRU(buf_pool)) {
n->unzip_LRU_evicted
= buf_free_from_unzip_LRU_list_batch(buf_pool, max);
diff --git a/storage/xtradb/buf/buf0lru.cc b/storage/xtradb/buf/buf0lru.cc
index e9b6d8f3fb5..f2ce261c9df 100644
--- a/storage/xtradb/buf/buf0lru.cc
+++ b/storage/xtradb/buf/buf0lru.cc
@@ -526,7 +526,7 @@ buf_flush_or_remove_page(
mutex_exit(block_mutex);
- *must_restart = TRUE;
+ *must_restart = true;
processed = false;
} else if (!flush) {
diff --git a/storage/xtradb/buf/buf0rea.cc b/storage/xtradb/buf/buf0rea.cc
index 7a79958c136..63d2fdf7726 100644
--- a/storage/xtradb/buf/buf0rea.cc
+++ b/storage/xtradb/buf/buf0rea.cc
@@ -641,9 +641,9 @@ buf_read_ahead_linear(
fail_count = 0;
- for (i = low; i < high; i++) {
+ prio_rw_lock_t* hash_lock;
- prio_rw_lock_t* hash_lock;
+ for (i = low; i < high; i++) {
bpage = buf_page_hash_get_s_locked(buf_pool, space, i,
&hash_lock);
@@ -692,7 +692,7 @@ buf_read_ahead_linear(
/* If we got this far, we know that enough pages in the area have
been accessed in the right order: linear read-ahead can be sensible */
- bpage = buf_page_hash_get(buf_pool, space, offset);
+ bpage = buf_page_hash_get_s_locked(buf_pool, space, offset, &hash_lock);
if (bpage == NULL) {
@@ -720,6 +720,8 @@ buf_read_ahead_linear(
pred_offset = fil_page_get_prev(frame);
succ_offset = fil_page_get_next(frame);
+ rw_lock_s_unlock(hash_lock);
+
if ((offset == low) && (succ_offset == offset + 1)) {
/* This is ok, we can continue */