List:Commits« Previous MessageNext Message »
From:Mikael Ronstrom Date:March 17 2010 9:19am
Subject:bzr commit into mysql-next-mr branch (mikael:3132)
View as plain text  
#At file:///home/mikael/mysql_clones/mysql-next-mr-buf-pool-split/ based on revid:mikael@stripped

 3132 Mikael Ronstrom	2010-03-17
      Step 16: Split buffer pool

    modified:
      storage/innobase/include/buf0buf.ic
      storage/innobase/include/buf0flu.ic
=== modified file 'storage/innobase/include/buf0buf.ic'
--- a/storage/innobase/include/buf0buf.ic	2010-03-16 17:38:48 +0000
+++ b/storage/innobase/include/buf0buf.ic	2010-03-17 09:19:32 +0000
@@ -144,26 +144,33 @@ ib_uint64_t
 buf_pool_get_oldest_modification(void)
 /*==================================*/
 {
+        buf_pool_t*     buf_pool;
 	buf_page_t*	bpage;
 	ib_uint64_t	lsn;
+	ib_uint64_t	oldest_lsn = 0;
+        ulint           i;
 
-	buf_pool_mutex_enter(buf_pool);
-
-	bpage = UT_LIST_GET_LAST(buf_pool->flush_list);
-
-	if (bpage == NULL) {
-		lsn = 0;
-	} else {
-		ut_ad(bpage->in_flush_list);
-		lsn = bpage->oldest_modification;
-	}
-
-	buf_pool_mutex_exit(buf_pool);
-
+        for (i = 0; i < srv_buf_pool_instances; i++) {
+                buf_pool = buf_pool_from_array(i);
+	        buf_pool_mutex_enter(buf_pool);
+
+	        bpage = UT_LIST_GET_LAST(buf_pool->flush_list);
+
+	        if (bpage == NULL) {
+		        lsn = 0;
+	        } else {
+		        ut_ad(bpage->in_flush_list);
+		        lsn = bpage->oldest_modification;
+	        }
+
+	        buf_pool_mutex_exit(buf_pool);
+                if (!oldest_lsn || oldest_lsn > lsn)
+                        oldest_lsn = lsn;
+        }
 	/* The returned answer may be out of date: the flush_list can
 	change after the mutex has been released. */
 
-	return(lsn);
+	return(oldest_lsn);
 }
 #endif /* !UNIV_HOTBACKUP */
 

=== modified file 'storage/innobase/include/buf0flu.ic'
--- a/storage/innobase/include/buf0flu.ic	2010-03-10 13:46:31 +0000
+++ b/storage/innobase/include/buf0flu.ic	2010-03-17 09:19:32 +0000
@@ -55,13 +55,16 @@ buf_flush_note_modification(
 	buf_block_t*	block,	/*!< in: block which is modified */
 	mtr_t*		mtr)	/*!< in: mtr */
 {
+#ifdef UNIV_DEBUG
+        buf_pool_t*     buf_pool = buf_pool_from_bpage(&block->page);
+	ut_ad(buf_pool_mutex_own(buf_pool));
+#endif
 	ut_ad(block);
 	ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
 	ut_ad(block->page.buf_fix_count > 0);
 #ifdef UNIV_SYNC_DEBUG
 	ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX));
 #endif /* UNIV_SYNC_DEBUG */
-	ut_ad(buf_pool_mutex_own(buf_pool));
 
 	ut_ad(mtr->start_lsn != 0);
 	ut_ad(mtr->modifications);
@@ -94,6 +97,7 @@ buf_flush_recv_note_modification(
 	ib_uint64_t	end_lsn)	/*!< in: end lsn of the last mtr in the
 					set of mtr's */
 {
+        buf_pool_t*     buf_pool = buf_pool_from_bpage(&block->page);
 	ut_ad(block);
 	ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
 	ut_ad(block->page.buf_fix_count > 0);


Attachment: [text/bzr-bundle] bzr/mikael@mysql.com-20100317091932-8hzx132gu5khux66.bundle
Thread
bzr commit into mysql-next-mr branch (mikael:3132) Mikael Ronstrom17 Mar