List:Commits« Previous MessageNext Message »
From:Inaam Rana Date:September 7 2011 8:56pm
Subject:bzr commit into mysql-trunk branch (inaam.rana:3446)
View as plain text  
#At file:///home/inaam/w/pb2/ based on revid:vasil.dimov@stripped

 3446 Inaam Rana	2011-09-07
      Disable trx_sys::mutex. This breaks MVCC but is only done to make a run
      on PB2 to analyze a performance regression

    modified:
      storage/innobase/read/read0read.c
      storage/innobase/trx/trx0trx.c
=== modified file 'storage/innobase/read/read0read.c'
--- a/storage/innobase/read/read0read.c	revid:vasil.dimov@stripped
+++ b/storage/innobase/read/read0read.c	revid:inaam.rana@stripped
@@ -293,26 +293,7 @@ read_view_add(
 /*==========*/
 	read_view_t*	view)		/*!< in: view to add to */
 {
-	read_view_t*	elem;
-	read_view_t*	prev_elem;
-
-	ut_ad(mutex_own(&trx_sys->mutex));
-	ut_ad(read_view_validate(view));
-
-	/* Find the correct slot for insertion. */
-	for (elem = UT_LIST_GET_FIRST(trx_sys->view_list), prev_elem = NULL;
-	     elem != NULL && view->low_limit_no < elem->low_limit_no;
-	     prev_elem = elem, elem = UT_LIST_GET_NEXT(view_list, elem)) {
-		/* No op */
-	}
-
-	if (prev_elem == NULL) {
-		UT_LIST_ADD_FIRST(view_list, trx_sys->view_list, view);
-	} else {
-		UT_LIST_INSERT_AFTER(
-			view_list, trx_sys->view_list, prev_elem, view);
-	}
-
+	UT_LIST_ADD_FIRST(view_list, trx_sys->view_list, view);
 	ut_ad(read_view_list_validate());
 }
 
@@ -331,7 +312,7 @@ read_view_open_now_low(
 {
 	const trx_t*	trx;
 	read_view_t*	view;
-	ulint		n_trx = UT_LIST_GET_LEN(trx_sys->trx_list);
+	ulint		n_trx = 1; // = UT_LIST_GET_LEN(trx_sys->trx_list);
 
 	ut_ad(mutex_own(&trx_sys->mutex));
 
@@ -350,6 +331,7 @@ read_view_open_now_low(
 
 	/* No active transaction should be visible, except cr_trx */
 
+#if 0
 	for (trx = UT_LIST_GET_FIRST(trx_sys->trx_list);
 	     trx != NULL;
 	     trx = UT_LIST_GET_NEXT(trx_list, trx)) {
@@ -383,7 +365,7 @@ read_view_open_now_low(
 			}
 		}
 	}
-
+#endif
 	view->n_trx_ids = n_trx;
 
 	if (view->n_trx_ids > 0) {
@@ -394,7 +376,7 @@ read_view_open_now_low(
 		view->up_limit_id = view->low_limit_id;
 	}
 
-	read_view_add(view);
+	//read_view_add(view);
 
 	return(view);
 }
@@ -414,11 +396,11 @@ read_view_open_now(
 {
 	read_view_t*	view;
 
-	mutex_enter(&trx_sys->mutex);
+	//mutex_enter(&trx_sys->mutex);
 
 	view = read_view_open_now_low(cr_trx_id, heap);
 
-	mutex_exit(&trx_sys->mutex);
+	//mutex_exit(&trx_sys->mutex);
 
 	return(view);
 }
@@ -504,7 +486,7 @@ read_view_purge_open(
 		view->up_limit_id = oldest_view->up_limit_id;
 	}
 
-	read_view_add(view);
+	//read_view_add(view);
 
 	mutex_exit(&trx_sys->mutex);
 
@@ -519,15 +501,15 @@ read_view_remove(
 /*=============*/
 	read_view_t*	view)	/*!< in: read view */
 {
-	mutex_enter(&trx_sys->mutex);
+	//mutex_enter(&trx_sys->mutex);
 
-	ut_ad(read_view_validate(view));
+	//ut_ad(read_view_validate(view));
 
-	UT_LIST_REMOVE(view_list, trx_sys->view_list, view);
+	//UT_LIST_REMOVE(view_list, trx_sys->view_list, view);
 
-	ut_ad(read_view_list_validate());
+	//ut_ad(read_view_list_validate());
 
-	mutex_exit(&trx_sys->mutex);
+	//mutex_exit(&trx_sys->mutex);
 }
 
 /*********************************************************************//**
@@ -620,10 +602,13 @@ read_cursor_view_create_for_mysql(
 
 	cr_trx->n_mysql_tables_in_use = 0;
 
+#if 0
 	mutex_enter(&trx_sys->mutex);
 
 	n_trx = UT_LIST_GET_LEN(trx_sys->trx_list);
-
+#else
+	n_trx = 1;
+#endif
 	curview->read_view = read_view_create_low(n_trx, curview->heap);
 
 	n_trx = 0;
@@ -638,6 +623,7 @@ read_cursor_view_create_for_mysql(
 	view->low_limit_no = trx_sys->max_trx_id;
 	view->low_limit_id = view->low_limit_no;
 
+#if 0
 	/* No active transaction should be visible */
 
 	for (trx = UT_LIST_GET_FIRST(trx_sys->trx_list);
@@ -669,6 +655,7 @@ read_cursor_view_create_for_mysql(
 			}
 		}
 	}
+#endif
 
 	view->n_trx_ids = n_trx;
 
@@ -680,9 +667,10 @@ read_cursor_view_create_for_mysql(
 		view->up_limit_id = view->low_limit_id;
 	}
 
-	read_view_add(view);
-
+	//read_view_add(view);
+#if 0
 	mutex_exit(&trx_sys->mutex);
+#endif
 
 	return(curview);
 }

=== modified file 'storage/innobase/trx/trx0trx.c'
--- a/storage/innobase/trx/trx0trx.c	revid:vasil.dimov@stripped
+++ b/storage/innobase/trx/trx0trx.c	revid:inaam.rana@stripped
@@ -678,7 +678,7 @@ trx_start_low(
 	ut_a(ib_vector_is_empty(trx->autoinc_locks));
 	ut_a(ib_vector_is_empty(trx->lock.table_locks));
 
-	mutex_enter(&trx_sys->mutex);
+	//mutex_enter(&trx_sys->mutex);
 
 	/* If this transaction came from trx_allocate_for_mysql(),
 	trx->in_mysql_trx_list would hold. In that case, the trx->state
@@ -689,13 +689,13 @@ trx_start_low(
 
 	trx->id = trx_sys_get_new_trx_id();
 
-	UT_LIST_ADD_FIRST(trx_list, trx_sys->trx_list, trx);
+	//UT_LIST_ADD_FIRST(trx_list, trx_sys->trx_list, trx);
 	ut_ad(!trx->in_trx_list);
 	ut_d(trx->in_trx_list = TRUE);
 
 	ut_ad(trx_sys_validate_trx_list());
 
-	mutex_exit(&trx_sys->mutex);
+	//mutex_exit(&trx_sys->mutex);
 
 	MONITOR_INC(MONITOR_TRX_ACTIVE);
 }
@@ -875,10 +875,10 @@ trx_commit(
 	now that it no longer holds any user locks. */
 
 	ut_ad(trx_state_eq(trx, TRX_STATE_COMMITTED_IN_MEMORY));
-	mutex_enter(&trx_sys->mutex);
+	//mutex_enter(&trx_sys->mutex);
 	ut_ad(trx->in_trx_list);
 	ut_d(trx->in_trx_list = FALSE);
-	UT_LIST_REMOVE(trx_list, trx_sys->trx_list, trx);
+	//UT_LIST_REMOVE(trx_list, trx_sys->trx_list, trx);
 
 	/* If this transaction came from trx_allocate_for_mysql(),
 	trx->in_mysql_trx_list would hold. In that case, the
@@ -888,7 +888,7 @@ trx_commit(
 	trx->state = TRX_STATE_NOT_STARTED;
 	ut_ad(trx_sys_validate_trx_list());
 	MONITOR_INC(MONITOR_TRX_COMMIT);
-	mutex_exit(&trx_sys->mutex);
+	//mutex_exit(&trx_sys->mutex);
 
 	if (trx->global_read_view != NULL) {
 		read_view_remove(trx->global_read_view);


Attachment: [text/bzr-bundle] bzr/inaam.rana@oracle.com-20110907205541-fb0td3dviul7acmi.bundle
Thread
bzr commit into mysql-trunk branch (inaam.rana:3446) Inaam Rana8 Sep