Skip to content
Permalink
Browse files
MDEV-14304 Unnecessary conditions in buf_page_get_gen()
Ever since MDEV-10813 cleaned up InnoDB use of atomic memory operations
and made buf_block_fix() an atomic operation, some conditions around
buf_block_fix() have been unnecessary.
  • Loading branch information
dr-m committed Nov 7, 2017
1 parent fff7fc5 commit d04c4b3
Showing 1 changed file with 2 additions and 31 deletions.
@@ -4263,24 +4263,7 @@ buf_page_get_gen(
sure that no state change takes place. */
fix_block = block;

if (fsp_is_system_temporary(page_id.space())) {
/* For temporary tablespace,
the mutex is being used for
synchronization between user
thread and flush thread,
instead of block->lock. See
buf_flush_page() for the flush
thread counterpart. */

BPageMutex* fix_mutex
= buf_page_get_mutex(
&fix_block->page);
mutex_enter(fix_mutex);
buf_block_fix(fix_block);
mutex_exit(fix_mutex);
} else {
buf_block_fix(fix_block);
}
buf_block_fix(fix_block);

/* Now safe to release page_hash mutex */
rw_lock_x_unlock(hash_lock);
@@ -4371,19 +4354,7 @@ buf_page_get_gen(
fix_block = block;
}

if (fsp_is_system_temporary(page_id.space())) {
/* For temporary tablespace, the mutex is being used
for synchronization between user thread and flush
thread, instead of block->lock. See buf_flush_page()
for the flush thread counterpart. */
BPageMutex* fix_mutex = buf_page_get_mutex(
&fix_block->page);
mutex_enter(fix_mutex);
buf_block_fix(fix_block);
mutex_exit(fix_mutex);
} else {
buf_block_fix(fix_block);
}
buf_block_fix(fix_block);

/* Now safe to release page_hash mutex */
rw_lock_s_unlock(hash_lock);

0 comments on commit d04c4b3

Please sign in to comment.