Merge mysql-5.1 to mysql-5.5.
This patch was already pushed to mysql-5.5 by Inaam Rana.
This commit is contained in:
commit
f2a5309418
@ -79,7 +79,6 @@ buf_buddy_add_to_free(
|
||||
ut_ad(buf_page_get_state(bpage) == BUF_BLOCK_ZIP_FREE);
|
||||
ut_ad(buf_pool->zip_free[i].start != bpage);
|
||||
UT_LIST_ADD_FIRST(list, buf_pool->zip_free[i], bpage);
|
||||
|
||||
}
|
||||
|
||||
/**********************************************************************//**
|
||||
@ -104,7 +103,6 @@ buf_buddy_remove_from_free(
|
||||
ut_ad(buf_pool_mutex_own(buf_pool));
|
||||
ut_ad(buf_page_get_state(bpage) == BUF_BLOCK_ZIP_FREE);
|
||||
UT_LIST_REMOVE(list, buf_pool->zip_free[i], bpage);
|
||||
|
||||
}
|
||||
|
||||
/**********************************************************************//**
|
||||
@ -262,19 +260,19 @@ buf_buddy_alloc_from(
|
||||
Allocate a block. The thread calling this function must hold
|
||||
buf_pool->mutex and must not hold buf_pool->zip_mutex or any block->mutex.
|
||||
The buf_pool_mutex may be released and reacquired.
|
||||
@return allocated block, never NULL */
|
||||
@return allocated block, never NULL */
|
||||
UNIV_INTERN
|
||||
void*
|
||||
buf_buddy_alloc_low(
|
||||
/*================*/
|
||||
buf_pool_t* buf_pool, /*!< in: buffer pool instance */
|
||||
buf_pool_t* buf_pool, /*!< in/out: buffer pool instance */
|
||||
ulint i, /*!< in: index of buf_pool->zip_free[],
|
||||
or BUF_BUDDY_SIZES */
|
||||
ibool* lru) /*!< in: pointer to a variable that
|
||||
will be assigned TRUE if storage was
|
||||
allocated from the LRU list and
|
||||
buf_pool->mutex was temporarily
|
||||
released, */
|
||||
released */
|
||||
{
|
||||
buf_block_t* block;
|
||||
|
||||
@ -353,7 +351,6 @@ buf_buddy_relocate(
|
||||
header. Should the fields be invalid, we will be unable to
|
||||
relocate the block. */
|
||||
|
||||
|
||||
/* The src block may be split into smaller blocks,
|
||||
some of which may be free. Thus, the
|
||||
mach_read_from_4() calls below may attempt to read
|
||||
@ -362,10 +359,10 @@ buf_buddy_relocate(
|
||||
pool), so there is nothing wrong about this. The
|
||||
mach_read_from_4() calls here will only trigger bogus
|
||||
Valgrind memcheck warnings in UNIV_DEBUG_VALGRIND builds. */
|
||||
space = mach_read_from_4((const byte*) src +
|
||||
FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
|
||||
page_no = mach_read_from_4((const byte*) src +
|
||||
FIL_PAGE_OFFSET);
|
||||
space = mach_read_from_4((const byte *) src
|
||||
+ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
|
||||
page_no = mach_read_from_4((const byte *) src
|
||||
+ FIL_PAGE_OFFSET);
|
||||
/* Suppress Valgrind warnings about conditional jump
|
||||
on uninitialized value. */
|
||||
UNIV_MEM_VALID(&space, sizeof space);
|
||||
@ -381,8 +378,6 @@ buf_buddy_relocate(
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
ut_ad(!buf_pool_watch_is_sentinel(buf_pool, bpage));
|
||||
|
||||
if (page_zip_get_size(&bpage->zip) != size) {
|
||||
/* The block is of different size. We would
|
||||
have to relocate all blocks covered by src.
|
||||
@ -462,21 +457,21 @@ recombine:
|
||||
if (UT_LIST_GET_LEN(buf_pool->zip_free[i]) < 16) {
|
||||
goto func_exit;
|
||||
}
|
||||
|
||||
|
||||
/* Try to combine adjacent blocks. */
|
||||
buddy = (buf_page_t*) buf_buddy_get(((byte*) buf), BUF_BUDDY_LOW << i);
|
||||
|
||||
#ifndef UNIV_DEBUG_VALGRIND
|
||||
buddy = (buf_page_t*) buf_buddy_get(((byte*) buf), BUF_BUDDY_LOW << i);
|
||||
|
||||
#ifndef UNIV_DEBUG_VALGRIND
|
||||
/* When Valgrind instrumentation is not enabled, we can read
|
||||
buddy->state to quickly determine that a block is not free.
|
||||
When the block is not free, buddy->state belongs to a compressed
|
||||
page frame that may be flagged uninitialized in our Valgrind
|
||||
instrumentation. */
|
||||
|
||||
if (buddy->state != BUF_BLOCK_ZIP_FREE) {
|
||||
|
||||
goto buddy_nonfree;
|
||||
}
|
||||
|
||||
if (buddy->state != BUF_BLOCK_ZIP_FREE) {
|
||||
|
||||
goto buddy_nonfree;
|
||||
}
|
||||
#endif /* !UNIV_DEBUG_VALGRIND */
|
||||
|
||||
for (bpage = UT_LIST_GET_FIRST(buf_pool->zip_free[i]); bpage; ) {
|
||||
@ -503,12 +498,13 @@ buddy_is_free:
|
||||
buddy_nonfree:
|
||||
#endif /* !UNIV_DEBUG_VALGRIND */
|
||||
|
||||
ut_d(BUF_BUDDY_LIST_VALIDATE(buf_pool, i));
|
||||
ut_d(BUF_BUDDY_LIST_VALIDATE(buf_pool, i));
|
||||
|
||||
/* The buddy is not free. Is there a free block of this size? */
|
||||
bpage = UT_LIST_GET_FIRST(buf_pool->zip_free[i]);
|
||||
|
||||
if (bpage) {
|
||||
|
||||
/* Remove the block from the free list, because a successful
|
||||
buf_buddy_relocate() will overwrite bpage->list. */
|
||||
buf_buddy_remove_from_free(buf_pool, bpage, i);
|
||||
|
@ -3272,7 +3272,6 @@ err_exit:
|
||||
bpage->space = space;
|
||||
bpage->offset = offset;
|
||||
|
||||
|
||||
#ifdef UNIV_DEBUG
|
||||
bpage->in_page_hash = FALSE;
|
||||
bpage->in_zip_hash = FALSE;
|
||||
|
@ -1819,7 +1819,6 @@ buf_LRU_block_remove_hashed_page(
|
||||
|
||||
buf_pool_mutex_exit_allow(buf_pool);
|
||||
buf_page_free_descriptor(bpage);
|
||||
|
||||
return(BUF_BLOCK_ZIP_FREE);
|
||||
|
||||
case BUF_BLOCK_FILE_PAGE:
|
||||
|
@ -37,14 +37,14 @@ Created December 2006 by Marko Makela
|
||||
/**********************************************************************//**
|
||||
Allocate a block. The thread calling this function must hold
|
||||
buf_pool->mutex and must not hold buf_pool->zip_mutex or any
|
||||
block->mutex. The buf_pool_mutex may be released and reacquired.
|
||||
block->mutex. The buf_pool->mutex may be released and reacquired.
|
||||
This function should only be used for allocating compressed page frames.
|
||||
@return allocated block, never NULL */
|
||||
UNIV_INLINE
|
||||
void*
|
||||
byte*
|
||||
buf_buddy_alloc(
|
||||
/*============*/
|
||||
buf_pool_t* buf_pool, /*!< in: buffer pool in which
|
||||
buf_pool_t* buf_pool, /*!< in/out: buffer pool in which
|
||||
the page resides */
|
||||
ulint size, /*!< in: compressed page size
|
||||
(between PAGE_ZIP_MIN_SIZE and
|
||||
@ -57,16 +57,17 @@ buf_buddy_alloc(
|
||||
__attribute__((malloc, nonnull));
|
||||
|
||||
/**********************************************************************//**
|
||||
Release a block. */
|
||||
Deallocate a block. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
buf_buddy_free(
|
||||
/*===========*/
|
||||
buf_pool_t* buf_pool,
|
||||
/*!< buffer pool in which the block resides */
|
||||
void* buf, /*!< in: block to be freed, must not be
|
||||
pointed to by the buffer pool */
|
||||
ulint size) /*!< in: block size, up to UNIV_PAGE_SIZE */
|
||||
buf_pool_t* buf_pool, /*!< in/out: buffer pool in which
|
||||
the block resides */
|
||||
void* buf, /*!< in: block to be freed, must not
|
||||
be pointed to by the buffer pool */
|
||||
ulint size) /*!< in: block size,
|
||||
up to UNIV_PAGE_SIZE */
|
||||
__attribute__((nonnull));
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
|
@ -42,13 +42,14 @@ UNIV_INTERN
|
||||
void*
|
||||
buf_buddy_alloc_low(
|
||||
/*================*/
|
||||
buf_pool_t* buf_pool,
|
||||
/*!< in: buffer pool in which the page resides */
|
||||
ulint i, /*!< in: index of buf_pool->zip_free[],
|
||||
or BUF_BUDDY_SIZES */
|
||||
ibool* lru) /*!< in: pointer to a variable that will be assigned
|
||||
TRUE if storage was allocated from the LRU list
|
||||
and buf_pool_mutex was temporarily released */
|
||||
buf_pool_t* buf_pool, /*!< in/out: buffer pool instance */
|
||||
ulint i, /*!< in: index of buf_pool->zip_free[],
|
||||
or BUF_BUDDY_SIZES */
|
||||
ibool* lru) /*!< in: pointer to a variable that
|
||||
will be assigned TRUE if storage was
|
||||
allocated from the LRU list and
|
||||
buf_pool->mutex was temporarily
|
||||
released */
|
||||
__attribute__((malloc, nonnull));
|
||||
|
||||
/**********************************************************************//**
|
||||
@ -88,14 +89,14 @@ buf_buddy_get_slot(
|
||||
/**********************************************************************//**
|
||||
Allocate a block. The thread calling this function must hold
|
||||
buf_pool->mutex and must not hold buf_pool->zip_mutex or any
|
||||
block->mutex. The buf_pool_mutex may be released and reacquired.
|
||||
block->mutex. The buf_pool->mutex may be released and reacquired.
|
||||
This function should only be used for allocating compressed page frames.
|
||||
@return allocated block, never NULL */
|
||||
UNIV_INLINE
|
||||
void*
|
||||
byte*
|
||||
buf_buddy_alloc(
|
||||
/*============*/
|
||||
buf_pool_t* buf_pool, /*!< in: buffer pool in which
|
||||
buf_pool_t* buf_pool, /*!< in/out: buffer pool in which
|
||||
the page resides */
|
||||
ulint size, /*!< in: compressed page size
|
||||
(between PAGE_ZIP_MIN_SIZE and
|
||||
@ -111,7 +112,8 @@ buf_buddy_alloc(
|
||||
ut_ad(size >= PAGE_ZIP_MIN_SIZE);
|
||||
ut_ad(size <= UNIV_PAGE_SIZE);
|
||||
|
||||
return(buf_buddy_alloc_low(buf_pool, buf_buddy_get_slot(size), lru));
|
||||
return((byte*) buf_buddy_alloc_low(buf_pool, buf_buddy_get_slot(size),
|
||||
lru));
|
||||
}
|
||||
|
||||
/**********************************************************************//**
|
||||
@ -120,11 +122,12 @@ UNIV_INLINE
|
||||
void
|
||||
buf_buddy_free(
|
||||
/*===========*/
|
||||
buf_pool_t* buf_pool, /*!< in: buffer pool instance */
|
||||
void* buf, /*!< in: block to be freed, must not be
|
||||
pointed to by the buffer pool */
|
||||
ulint size) /*!< in: block size, up to
|
||||
UNIV_PAGE_SIZE */
|
||||
buf_pool_t* buf_pool, /*!< in/out: buffer pool in which
|
||||
the block resides */
|
||||
void* buf, /*!< in: block to be freed, must not
|
||||
be pointed to by the buffer pool */
|
||||
ulint size) /*!< in: block size,
|
||||
up to UNIV_PAGE_SIZE */
|
||||
{
|
||||
ut_ad(buf_pool_mutex_own(buf_pool));
|
||||
ut_ad(ut_is_2pow(size));
|
||||
|
@ -284,6 +284,7 @@ buf_page_free_descriptor(
|
||||
/*=====================*/
|
||||
buf_page_t* bpage) /*!< in: bpage descriptor to free. */
|
||||
__attribute__((nonnull));
|
||||
|
||||
/********************************************************************//**
|
||||
Allocates a buffer block.
|
||||
@return own: the allocated block, in state BUF_BLOCK_MEMORY */
|
||||
|
Loading…
x
Reference in New Issue
Block a user