Commit b36300e1 authored by marko's avatar marko

branches/zip: buf_page_create(): Do not IO-fix or X-latch the block

when not invoking buf_buddy_alloc().
parent 5ac6f321
...@@ -2573,15 +2573,16 @@ buf_page_create( ...@@ -2573,15 +2573,16 @@ buf_page_create(
buf_block_buf_fix_inc(block, __FILE__, __LINE__); buf_block_buf_fix_inc(block, __FILE__, __LINE__);
buf_pool->n_pages_created++; buf_pool->n_pages_created++;
/* Prevent race conditions during buf_buddy_alloc(),
which may release and reacquire buf_pool->mutex,
by IO-fixing and X-latching the block. */
buf_page_set_io_fix(&block->page, BUF_IO_READ);
rw_lock_x_lock(&block->lock);
if (zip_size) { if (zip_size) {
void* data; void* data;
/* Prevent race conditions during buf_buddy_alloc(),
which may release and reacquire buf_pool->mutex,
by IO-fixing and X-latching the block. */
buf_page_set_io_fix(&block->page, BUF_IO_READ);
rw_lock_x_lock(&block->lock);
page_zip_set_size(&block->page.zip, zip_size); page_zip_set_size(&block->page.zip, zip_size);
mutex_exit(&block->mutex); mutex_exit(&block->mutex);
/* buf_pool->mutex may be released and reacquired by /* buf_pool->mutex may be released and reacquired by
...@@ -2593,10 +2594,10 @@ buf_page_create( ...@@ -2593,10 +2594,10 @@ buf_page_create(
data = buf_buddy_alloc(zip_size, TRUE); data = buf_buddy_alloc(zip_size, TRUE);
mutex_enter(&block->mutex); mutex_enter(&block->mutex);
block->page.zip.data = data; block->page.zip.data = data;
}
buf_page_set_io_fix(&block->page, BUF_IO_NONE); buf_page_set_io_fix(&block->page, BUF_IO_NONE);
rw_lock_x_unlock(&block->lock); rw_lock_x_unlock(&block->lock);
}
mutex_exit(&(buf_pool->mutex)); mutex_exit(&(buf_pool->mutex));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment