summaryrefslogtreecommitdiff
path: root/innobase/buf
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2004-03-12 17:14:51 +0200
committerunknown <marko@hundin.mysql.fi>2004-03-12 17:14:51 +0200
commite1cb1ca6fe25380edae06ded5e22e106761dcb46 (patch)
tree6a59a674bf740a7b4046a20e847ad2578a573d69 /innobase/buf
parent9a817bea5a369306dbb2113fbc599e63d5bb7d17 (diff)
downloadmariadb-git-e1cb1ca6fe25380edae06ded5e22e106761dcb46.tar.gz
Allow UNIV_SYNC_DEBUG to be disabled while UNIV_DEBUG is enabled
Diffstat (limited to 'innobase/buf')
-rw-r--r--innobase/buf/buf0buf.c9
-rw-r--r--innobase/buf/buf0flu.c11
-rw-r--r--innobase/buf/buf0lru.c16
3 files changed, 31 insertions, 5 deletions
diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c
index 1c0315131b2..e2661725912 100644
--- a/innobase/buf/buf0buf.c
+++ b/innobase/buf/buf0buf.c
@@ -446,9 +446,10 @@ buf_block_init(
rw_lock_create(&(block->read_lock));
rw_lock_set_level(&(block->read_lock), SYNC_NO_ORDER_CHECK);
-
+#ifdef UNIV_SYNC_DEBUG
rw_lock_create(&(block->debug_latch));
rw_lock_set_level(&(block->debug_latch), SYNC_NO_ORDER_CHECK);
+#endif /* UNIV_SYNC_DEBUG */
}
/************************************************************************
@@ -1088,9 +1089,9 @@ buf_page_optimistic_get_func(
}
if (!UT_DULINT_EQ(modify_clock, block->modify_clock)) {
-
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(block->frame, SYNC_NO_ORDER_CHECK);
-
+#endif /* UNIV_SYNC_DEBUG */
if (rw_latch == RW_S_LATCH) {
rw_lock_s_unlock(&(block->lock));
} else {
@@ -1285,7 +1286,9 @@ buf_page_init(
in units of a page */
buf_block_t* block) /* in: block to init */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(block->state == BUF_BLOCK_READY_FOR_USE);
/* Set the state of the block */
diff --git a/innobase/buf/buf0flu.c b/innobase/buf/buf0flu.c
index c0999ee4841..9ed99096451 100644
--- a/innobase/buf/buf0flu.c
+++ b/innobase/buf/buf0flu.c
@@ -47,7 +47,9 @@ buf_flush_insert_into_flush_list(
/*=============================*/
buf_block_t* block) /* in: block which is modified */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad((UT_LIST_GET_FIRST(buf_pool->flush_list) == NULL)
|| (ut_dulint_cmp(
@@ -73,7 +75,9 @@ buf_flush_insert_sorted_into_flush_list(
buf_block_t* prev_b;
buf_block_t* b;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
prev_b = NULL;
b = UT_LIST_GET_FIRST(buf_pool->flush_list);
@@ -105,7 +109,9 @@ buf_flush_ready_for_replace(
buf_block_t* block) /* in: buffer control block, must be in state
BUF_BLOCK_FILE_PAGE and in the LRU list*/
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
if ((ut_dulint_cmp(block->oldest_modification, ut_dulint_zero) > 0)
@@ -129,7 +135,9 @@ buf_flush_ready_for_flush(
BUF_BLOCK_FILE_PAGE */
ulint flush_type)/* in: BUF_FLUSH_LRU or BUF_FLUSH_LIST */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(block->state == BUF_BLOCK_FILE_PAGE);
if ((ut_dulint_cmp(block->oldest_modification, ut_dulint_zero) > 0)
@@ -161,8 +169,9 @@ buf_flush_write_complete(
buf_block_t* block) /* in: pointer to the block in question */
{
ut_ad(block);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
-
+#endif /* UNIV_SYNC_DEBUG */
block->oldest_modification = ut_dulint_zero;
UT_LIST_REMOVE(flush_list, buf_pool->flush_list, block);
diff --git a/innobase/buf/buf0lru.c b/innobase/buf/buf0lru.c
index 1d49833969f..c0b0cfbb6ea 100644
--- a/innobase/buf/buf0lru.c
+++ b/innobase/buf/buf0lru.c
@@ -370,7 +370,9 @@ buf_LRU_old_adjust_len(void)
ulint new_len;
ut_ad(buf_pool->LRU_old);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(3 * (BUF_LRU_OLD_MIN_LEN / 8) > BUF_LRU_OLD_TOLERANCE + 5);
for (;;) {
@@ -440,7 +442,9 @@ buf_LRU_remove_block(
{
ut_ad(buf_pool);
ut_ad(block);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
/* If the LRU_old pointer is defined and points to just this block,
move it backward one step */
@@ -493,7 +497,9 @@ buf_LRU_add_block_to_end_low(
ut_ad(buf_pool);
ut_ad(block);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
block->old = TRUE;
@@ -545,7 +551,9 @@ buf_LRU_add_block_low(
ut_ad(buf_pool);
ut_ad(block);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
block->old = old;
cl = buf_pool_clock_tic();
@@ -632,7 +640,9 @@ buf_LRU_block_free_non_file_page(
/*=============================*/
buf_block_t* block) /* in: block, must not contain a file page */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(block);
ut_ad((block->state == BUF_BLOCK_MEMORY)
@@ -658,7 +668,9 @@ buf_LRU_block_remove_hashed_page(
be in a state where it can be freed; there
may or may not be a hash index to the page */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(block);
ut_ad(block->state == BUF_BLOCK_FILE_PAGE);
@@ -672,7 +684,7 @@ buf_LRU_block_remove_hashed_page(
buf_pool->freed_page_clock += 1;
buf_frame_modify_clock_inc(block->frame);
-
+
HASH_DELETE(buf_block_t, hash, buf_pool->page_hash,
buf_page_address_fold(block->space, block->offset),
block);
@@ -689,7 +701,9 @@ buf_LRU_block_free_hashed_page(
buf_block_t* block) /* in: block, must contain a file page and
be in a state where it can be freed */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(block->state == BUF_BLOCK_REMOVE_HASH);
block->state = BUF_BLOCK_MEMORY;