List:Commits« Previous MessageNext Message »
From:marko.makela Date:June 23 2011 1:17pm
Subject:bzr push into mysql-trunk branch (marko.makela:3232 to 3233)
View as plain text  
 3233 Marko Mäkelä	2011-06-23 [merge]
      Merge mysql-5.5 to mysql-trunk.

    modified:
      storage/innobase/buf/buf0buddy.c
      storage/innobase/buf/buf0buf.c
      storage/innobase/buf/buf0lru.c
      storage/innobase/include/buf0buddy.h
      storage/innobase/include/buf0buddy.ic
      storage/innobase/include/buf0buf.h
 3232 Marko Mäkelä	2011-06-23 [merge]
      Merge mysql-5.5 to mysql-trunk.

    modified:
      mysql-test/suite/innodb/r/innodb-index.result
      mysql-test/suite/innodb/t/innodb-index.test
=== modified file 'storage/innobase/buf/buf0buddy.c'
--- a/storage/innobase/buf/buf0buddy.c	revid:marko.makela@stripped
+++ b/storage/innobase/buf/buf0buddy.c	revid:marko.makela@oracle.com-20110623130309-e7m10c0boa62nsum
@@ -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);

=== modified file 'storage/innobase/buf/buf0buf.c'
--- a/storage/innobase/buf/buf0buf.c	revid:marko.makela@stripped5141-379yy9lk2mt6x30y
+++ b/storage/innobase/buf/buf0buf.c	revid:marko.makela@stripped62nsum
@@ -3494,7 +3494,6 @@ err_exit:
 		bpage->space	= space;
 		bpage->offset	= offset;
 
-
 #ifdef UNIV_DEBUG
 		bpage->in_page_hash = FALSE;
 		bpage->in_zip_hash = FALSE;

=== modified file 'storage/innobase/buf/buf0lru.c'
--- a/storage/innobase/buf/buf0lru.c	revid:marko.makela@oracle.com-20110623095141-379yy9lk2mt6x30y
+++ b/storage/innobase/buf/buf0lru.c	revid:marko.makela@stripped0623130309-e7m10c0boa62nsum
@@ -1876,7 +1876,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:

=== modified file 'storage/innobase/include/buf0buddy.h'
--- a/storage/innobase/include/buf0buddy.h	revid:marko.makela@stripped
+++ b/storage/innobase/include/buf0buddy.h	revid:marko.makela@oracle.com-20110623130309-e7m10c0boa62nsum
@@ -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 UNIV_ZIP_SIZE_MIN 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

=== modified file 'storage/innobase/include/buf0buddy.ic'
--- a/storage/innobase/include/buf0buddy.ic	revid:marko.makela@stripped
+++ b/storage/innobase/include/buf0buddy.ic	revid:marko.makela@stripped
@@ -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 UNIV_ZIP_SIZE_MIN and
@@ -111,7 +112,8 @@ buf_buddy_alloc(
 	ut_ad(size >= UNIV_ZIP_SIZE_MIN);
 	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));

=== modified file 'storage/innobase/include/buf0buf.h'
--- a/storage/innobase/include/buf0buf.h	revid:marko.makela@stripped
+++ b/storage/innobase/include/buf0buf.h	revid:marko.makela@stripped
@@ -290,6 +290,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 */

Attachment: [text/bzr-bundle] bzr/marko.makela@oracle.com-20110623130309-e7m10c0boa62nsum.bundle
Thread
bzr push into mysql-trunk branch (marko.makela:3232 to 3233) marko.makela23 Jun