- typo (double “get”) in the updated buf_LRU_free_page() comments:
“function returns false, the buf_page_get_get_mutex() might be temporarily”
- what’s the reason for changing buf_page_t::in_LRU_list to be present
in release builds? Unless I’m missing something in the current code,
it is only assigned, but never read in release builds?
- spurious blank line changes in buf_buddy_relocate(),
buf_buddy_free_low(), buf_pool_watch_set(), buf_page_get_gen(),
buf_page_init_for_read(), buf_pool_validate_instance(),
buf_flush_check_neighbor(), buf_flush_LRU_list_batch(), buf_LRU_drop_page_hash_for_tablespace()
and innodb_buffer_pool_evict_uncompressed().
- the following change in buf_block_try_discard_uncompressed() does
not release block_mutex if buf_LRU_free_page() returns false.
if (bpage->buf_fix_count
|| buf_page_get_io_fix(bpage) != BUF_IO_NONE) {
/* This condition often occurs when the buffer
is not buffer-fixed, but I/O-fixed by
buf_page_init_for_read(). */
- mutex_exit(block_mutex);
+ mutex_exit(&buf_pool->zip_mutex);
wait_until_unfixed:
/* The block is buffer-fixed or I/O-fixed.
Try again later. */
is there a reason for replacing block_mutex with zip_mutex? you
could just assert that block_mutex is zip_mutex next to, or even
instead of the buf_own_zip_mutex_for_page() call.
/* As we have released the page_hash lock and the
block_mutex to allocate an uncompressed page it is
- in buf_mark_space_corrupt() I see LRU_list_mutex, hash_lock and
buf_page_get_mutex() being acquired, but only LRU_list_mutex and
buf_page_get_mutex() being released, i.e. it returns with hash_lock
acquired?
- it looks like with the changes in buf_page_io_complete() for io_type
== BUF_IO_WRITE we don’t set io_fix to BUF_IO_NONE, though we did
before the changes?
/********************************************************************//**
-Remove a block from the flush list of modified blocks. */
+Remove a block from the flush list of modified blocks. */
UNIV_INTERN
void
buf_flush_remove(
and
@@ -1693,7 +1729,7 @@ buf_flush_batch(
(if their number does not exceed
min_n), otherwise ignored */
{
- ulint count = 0;
+ ulint count = 0;
More comments on the patch:
- typo (double “get”) in the updated buf_LRU_free_page() comments: get_get_ mutex() might be temporarily”
“function returns false, the buf_page_
- what’s the reason for changing buf_page_ t::in_LRU_ list to be present
in release builds? Unless I’m missing something in the current code,
it is only assigned, but never read in release builds?
- spurious blank line changes in buf_buddy_ relocate( ), buddy_free_ low(), buf_pool_ watch_set( ), buf_page_get_gen(), page_init_ for_read( ), buf_pool_ validate_ instance( ), flush_check_ neighbor( ), buf_flush_ LRU_list_ batch() , buf_LRU_ drop_page_ hash_for_ tablespace( ) buffer_ pool_evict_ uncompressed( ).
buf_
buf_
buf_
and innodb_
- the following change in buf_block_ try_discard_ uncompressed( ) does
not release block_mutex if buf_LRU_free_page() returns false.
bpage = buf_page_ hash_get( buf_pool, space, offset);
if (bpage) { free_page( bpage, false); get_mutex( bpage); block_mutex) ; free_page( bpage, false)) { block_mutex) ;
- buf_LRU_
+
+ ib_mutex_t* block_mutex = buf_page_
+
+ mutex_enter(
+
+ if (buf_LRU_
+
+ mutex_exit(
+ return;
+ }
}
- do you really need this change?
@@ -2114,8 +2098,8 @@ buf_page_get_zip( ZIP_DIRTY: zip_mutex_ for_page( bpage); >zip_mutex; block_mutex) ; >buf_fix_ count++ ; FILE_PAGE:
break;
case BUF_BLOCK_ZIP_PAGE:
case BUF_BLOCK_
+ buf_enter_
block_mutex = &buf_pool-
- mutex_enter(
bpage-
goto got_block;
case BUF_BLOCK_
- in the following change:
@@ -2721,13 +2707,14 @@ buf_page_get_gen(
}
bpage = &block->page; own_zip_ mutex_for_ page(bpage) );
+ ut_ad(buf_
if (bpage- >buf_fix_ count get_io_ fix(bpage) != BUF_IO_NONE) { page_init_ for_read( ). */ block_mutex) ; &buf_pool- >zip_mutex) ; unfixed:
|| buf_page_
/* This condition often occurs when the buffer
is not buffer-fixed, but I/O-fixed by
buf_
- mutex_exit(
+ mutex_exit(
wait_until_
/* The block is buffer-fixed or I/O-fixed.
Try again later. */
is there a reason for replacing block_mutex with zip_mutex? you zip_mutex_ for_page( ) call.
could just assert that block_mutex is zip_mutex next to, or even
instead of the buf_own_
- same comments for this change:
@@ -2737,11 +2724,11 @@ buf_page_get_gen(
}
/* Allocate an uncompressed page. */ block_mutex) ; &buf_pool- >zip_mutex) ; get_free_ block(buf_ pool);
- mutex_exit(
+ mutex_exit(
block = buf_LRU_
ut_a(block);
- buf_pool_ mutex_enter( buf_pool) ; &buf_pool- >LRU_list_ mutex);
+ mutex_enter(
/* As we have released the page_hash lock and the
block_mutex to allocate an uncompressed page it is
- in buf_mark_ space_corrupt( ) I see LRU_list_mutex, hash_lock and page_get_ mutex() being acquired, but only LRU_list_mutex and page_get_ mutex() being released, i.e. it returns with hash_lock
buf_
buf_
acquired?
- it looks like with the changes in buf_page_ io_complete( ) for io_type
== BUF_IO_WRITE we don’t set io_fix to BUF_IO_NONE, though we did
before the changes?
- more spurious changes:
@@ -475,8 +473,8 @@ buf_flush_ insert_ sorted_ into_flush_ list( ADD_FIRST( list, buf_pool- >flush_ list, &block->page); INSERT_ AFTER(list, buf_pool- >flush_ list, INSERT_ AFTER(list, buf_pool- >flush_ list, prev_b,
if (prev_b == NULL) {
UT_LIST_
} else {
- UT_LIST_
- prev_b, &block->page);
+ UT_LIST_
+ &block->page);
}
incr_ flush_list_ size_in_ bytes(block, buf_pool);
@@ -573,7 +567,7 @@ buf_flush_ ready_for_ flush(
}
and
/***** ******* ******* ******* ******* ******* ******* ******* ******* ******* //**
-Remove a block from the flush list of modified blocks. */
+Remove a block from the flush list of modified blocks. */
UNIV_INTERN
void
buf_flush_remove(
and
@@ -1693,7 +1729,7 @@ buf_flush_batch(
(if their number does not exceed
min_n), otherwise ignored */
{
- ulint count = 0;
+ ulint count = 0;
ut_ad(flush_type == BUF_FLUSH_LRU || flush_type == BUF_FLUSH_LIST);
#ifdef UNIV_SYNC_DEBUG
and
@@ -1836,7 +1870,7 @@ buf_flush_ wait_batch_ end( wait_begin( NULL, THD_WAIT_DISKIO); wait(buf_ pool->no_ flush[type] ); wait(buf_ pool->no_ flush[type] ); wait_end( NULL);
}
} else {
thd_
- os_event_
+ os_event_
thd_
}
}
and
if (buf_pool- >n_flush[ BUF_FLUSH_ LRU] > 0 >init_flush[ BUF_FLUSH_ LRU]) { >init_flush[ BUF_FLUSH_ LRU]) {
- || buf_pool-
+ || buf_pool-
and
@@ -958,10 +1018,10 @@ buf_LRU_ free_from_ unzip_LRU_ list( LRU_scan_ depth / 2 blocks. */
srv_
{
buf_block_t* block;
- ibool freed;
+ ibool freed;
ulint scanned;
- in the following hunk there’s no really need for the “else” block,
and a call to mutex_exit() can be moved out of the “if” statement:
@@ -1316,14 +1317,14 @@ buf_flush_ try_neighbors(
buf_ flush_page( buf_pool, bpage, flush_type, false); ad(!mutex_ own(block_ mutex)) ; buf_pool_ mutex_own( buf_pool) ); block_mutex) ; block_mutex) ; block_mutex) ; mutex_exit( buf_pool) ;
ut_
- ut_ad(!
count++;
continue;
- } else {
- mutex_exit(
}
+ mutex_exit(
+ } else {
+
+ mutex_exit(
}
- buf_pool_
}
if (count > 0) {
- typo in the comments:
+ /* The following call will release the buf_pgae_ get_mutex( ) mutex. */ get_mutex( ) mutex therefore
...
+ As we are not holding LRU list or buf_pgae_