diff options
author | Sergei Golubchik <sergii@pisem.net> | 2015-02-18 20:31:40 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2015-02-18 20:31:40 +0100 |
commit | 174bccd3ff02b3d7c3957f56027b0956425cb31f (patch) | |
tree | 99f3490019cd5902f4ae7a5f66ab073127affd00 /storage/xtradb/buf | |
parent | 6b05688f6d8920171fe14453082101316fa2dd8e (diff) | |
parent | dfb001edcd4b16bd4370b08b0176df78c4c5523f (diff) | |
download | mariadb-git-174bccd3ff02b3d7c3957f56027b0956425cb31f.tar.gz |
xtradb 5.6.22-72.0
Diffstat (limited to 'storage/xtradb/buf')
-rw-r--r-- | storage/xtradb/buf/buf0buf.cc | 11 | ||||
-rw-r--r-- | storage/xtradb/buf/buf0flu.cc | 6 | ||||
-rw-r--r-- | storage/xtradb/buf/buf0lru.cc | 2 | ||||
-rw-r--r-- | storage/xtradb/buf/buf0rea.cc | 8 |
4 files changed, 12 insertions, 15 deletions
diff --git a/storage/xtradb/buf/buf0buf.cc b/storage/xtradb/buf/buf0buf.cc index d6f210e1430..d38e080051c 100644 --- a/storage/xtradb/buf/buf0buf.cc +++ b/storage/xtradb/buf/buf0buf.cc @@ -294,7 +294,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; @@ -1777,16 +1776,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); @@ -1838,7 +1833,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); @@ -1881,9 +1875,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); } } @@ -4467,7 +4459,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) { @@ -4487,6 +4479,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 ab48e4523b3..0f39c5de2ca 100644 --- a/storage/xtradb/buf/buf0flu.cc +++ b/storage/xtradb/buf/buf0flu.cc @@ -1093,8 +1093,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 @@ -1645,6 +1645,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 6e348bbf004..c28df72df92 100644 --- a/storage/xtradb/buf/buf0rea.cc +++ b/storage/xtradb/buf/buf0rea.cc @@ -640,9 +640,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); @@ -691,7 +691,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) { @@ -719,6 +719,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 */ |