percona-discussion team mailing list archive
-
percona-discussion team
-
Mailing list archive
-
Message #00609
[Merge] lp:~percona-dev/percona-patches/fix-bug328367 into lp:percona-patches
Yasufumi Kinoshita has proposed merging lp:~percona-dev/percona-patches/fix-bug328367 into lp:percona-patches.
Requested reviews:
Vadim Tkachenko (vadim-tk)
--
https://code.launchpad.net/~percona-dev/percona-patches/fix-bug328367/+merge/6702
Your team Percona developers is subscribed to branch lp:percona-patches.
=== modified file 'innodb_io_patches.patch'
--- innodb_io_patches.patch 2009-05-06 09:53:18 +0000
+++ innodb_io_patches.patch 2009-05-20 06:04:48 +0000
@@ -22,6 +22,14 @@
diff -ruN a/innobase/buf/buf0rea.c b/innobase/buf/buf0rea.c
--- a/innobase/buf/buf0rea.c 2009-05-06 10:04:12.000000000 +0900
+++ b/innobase/buf/buf0rea.c 2009-05-06 10:06:28.000000000 +0900
+@@ -20,6 +20,7 @@
+ #include "os0file.h"
+ #include "srv0start.h"
+
++extern ulint srv_read_ahead;
+ extern ulint srv_read_ahead_rnd;
+ extern ulint srv_read_ahead_seq;
+ extern ulint srv_buf_pool_reads;
@@ -189,6 +189,10 @@
ulint err;
ulint i;
=== modified file 'innodb_rw_lock.patch'
--- innodb_rw_lock.patch 2009-05-06 16:42:43 +0000
+++ innodb_rw_lock.patch 2009-05-20 06:04:48 +0000
@@ -1,3 +1,15 @@
+diff -ruN a/innobase/btr/btr0sea.c b/innobase/btr/btr0sea.c
+--- a/innobase/btr/btr0sea.c 2009-05-20 14:21:44.000000000 +0900
++++ b/innobase/btr/btr0sea.c 2009-05-20 14:39:34.000000000 +0900
+@@ -773,7 +773,7 @@
+ rw_lock_s_lock(&btr_search_latch);
+ }
+
+- ut_ad(btr_search_latch.writer != RW_LOCK_EX);
++ ut_ad(rw_lock_get_writer(&btr_search_latch) != RW_LOCK_EX);
+ ut_ad(btr_search_latch.reader_count > 0);
+
+ rec = ha_search_and_get_data(btr_search_sys->hash_index, fold);
diff -ruN a/innobase/include/sync0rw.h b/innobase/include/sync0rw.h
--- a/innobase/include/sync0rw.h 2009-01-30 06:42:20.000000000 +0900
+++ b/innobase/include/sync0rw.h 2009-04-16 16:15:28.000000000 +0900
@@ -808,7 +820,7 @@
if (UT_LIST_GET_PREV(list, lock)) {
ut_a(UT_LIST_GET_PREV(list, lock)->magic_n == RW_LOCK_MAGIC_N);
-@@ -192,6 +199,8 @@
+@@ -192,26 +199,43 @@
Checks that the rw-lock has been initialized and that there are no
simultaneous shared and exclusive locks. */
@@ -817,8 +829,9 @@
ibool
rw_lock_validate(
/*=============*/
-@@ -199,7 +208,9 @@
+ rw_lock_t* lock)
{
++ ulint test;
ut_a(lock);
+#ifndef HAVE_ATOMIC_BUILTINS
@@ -826,28 +839,37 @@
+#endif
ut_a(lock->magic_n == RW_LOCK_MAGIC_N);
++#ifndef HAVE_ATOMIC_BUILTINS
ut_a((rw_lock_get_reader_count(lock) == 0)
-@@ -207,11 +218,17 @@
- ut_a((rw_lock_get_writer(lock) == RW_LOCK_EX)
- || (rw_lock_get_writer(lock) == RW_LOCK_WAIT_EX)
- || (rw_lock_get_writer(lock) == RW_LOCK_NOT_LOCKED));
+ || (rw_lock_get_writer(lock) != RW_LOCK_EX));
+- ut_a((rw_lock_get_writer(lock) == RW_LOCK_EX)
+- || (rw_lock_get_writer(lock) == RW_LOCK_WAIT_EX)
+- || (rw_lock_get_writer(lock) == RW_LOCK_NOT_LOCKED));
- ut_a((rw_lock_get_waiters(lock) == 0)
- || (rw_lock_get_waiters(lock) == 1));
-+ ut_a((rw_lock_get_s_waiters(lock) == 0)
-+ || (rw_lock_get_s_waiters(lock) == 1));
-+ ut_a((rw_lock_get_x_waiters(lock) == 0)
-+ || (rw_lock_get_x_waiters(lock) == 1));
-+ ut_a((rw_lock_get_wx_waiters(lock) == 0)
-+ || (rw_lock_get_wx_waiters(lock) == 1));
++#endif
++ test = rw_lock_get_writer(lock);
++ ut_a((test == RW_LOCK_EX)
++ || (test == RW_LOCK_WAIT_EX)
++ || (test == RW_LOCK_NOT_LOCKED));
++ test = rw_lock_get_s_waiters(lock);
++ ut_a((test == 0)
++ || (test == 1));
++ test = rw_lock_get_x_waiters(lock);
++ ut_a((test == 0)
++ || (test == 1));
++ test = rw_lock_get_wx_waiters(lock);
++ ut_a((test == 0)
++ || (test == 1));
++#ifndef HAVE_ATOMIC_BUILTINS
ut_a((lock->writer != RW_LOCK_EX) || (lock->writer_count > 0));
-+#ifndef HAVE_ATOMIC_BUILTINS
mutex_exit(rw_lock_get_mutex(lock));
+#endif
return(TRUE);
}
-@@ -237,13 +254,14 @@
+@@ -237,13 +261,14 @@
ut_ad(rw_lock_validate(lock));
lock_loop:
@@ -865,7 +887,7 @@
if (srv_spin_wait_delay) {
ut_delay(ut_rnd_interval(0, srv_spin_wait_delay));
}
-@@ -262,15 +280,27 @@
+@@ -262,15 +287,27 @@
lock->cfile_name, (ulong) lock->cline, (ulong) i);
}
@@ -893,7 +915,7 @@
/* If we get here, locking did not succeed, we may
suspend the thread to wait in the wait array */
-@@ -281,9 +311,26 @@
+@@ -281,9 +318,26 @@
file_name, line,
&index);
@@ -921,7 +943,7 @@
if (srv_print_latch_waits) {
fprintf(stderr,
-@@ -318,13 +365,19 @@
+@@ -318,13 +372,19 @@
{
ut_ad(rw_lock_is_locked(lock, RW_LOCK_EX));
@@ -941,7 +963,7 @@
}
/**********************************************************************
-@@ -342,6 +395,89 @@
+@@ -342,6 +402,89 @@
const char* file_name,/* in: file name where lock requested */
ulint line) /* in: line where requested */
{
@@ -1031,7 +1053,7 @@
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(rw_lock_get_mutex(lock)));
#endif /* UNIV_SYNC_DEBUG */
-@@ -423,6 +559,7 @@
+@@ -423,6 +566,7 @@
/* Locking succeeded, we may return */
return(RW_LOCK_EX);
}
@@ -1039,7 +1061,7 @@
/* Locking did not succeed */
return(RW_LOCK_NOT_LOCKED);
-@@ -448,19 +585,33 @@
+@@ -448,19 +592,33 @@
ulint line) /* in: line where requested */
{
ulint index; /* index of the reserved wait cell */
@@ -1074,7 +1096,7 @@
if (state == RW_LOCK_EX) {
return; /* Locking succeeded */
-@@ -468,10 +619,9 @@
+@@ -468,10 +626,9 @@
} else if (state == RW_LOCK_NOT_LOCKED) {
/* Spin waiting for the writer field to become free */
@@ -1087,7 +1109,7 @@
if (srv_spin_wait_delay) {
ut_delay(ut_rnd_interval(0,
srv_spin_wait_delay));
-@@ -485,9 +635,12 @@
+@@ -485,9 +642,12 @@
} else if (state == RW_LOCK_WAIT_EX) {
/* Spin waiting for the reader count field to become zero */
@@ -1101,7 +1123,7 @@
&& i < SYNC_SPIN_ROUNDS) {
if (srv_spin_wait_delay) {
ut_delay(ut_rnd_interval(0,
-@@ -500,7 +653,6 @@
+@@ -500,7 +660,6 @@
os_thread_yield();
}
} else {
@@ -1109,7 +1131,7 @@
ut_error;
}
-@@ -516,34 +668,69 @@
+@@ -516,34 +675,69 @@
/* We try once again to obtain the lock. Acquire the mutex protecting
the rw-lock fields */
@@ -1185,7 +1207,7 @@
if (srv_print_latch_waits) {
fprintf(stderr,
-@@ -718,7 +905,9 @@
+@@ -718,7 +912,9 @@
ut_ad(lock);
ut_ad(rw_lock_validate(lock));
@@ -1195,7 +1217,7 @@
info = UT_LIST_GET_FIRST(lock->debug_list);
-@@ -728,7 +917,9 @@
+@@ -728,7 +924,9 @@
&& (info->pass == 0)
&& (info->lock_type == lock_type)) {
@@ -1205,7 +1227,7 @@
/* Found! */
return(TRUE);
-@@ -736,7 +927,9 @@
+@@ -736,7 +934,9 @@
info = UT_LIST_GET_NEXT(list, info);
}
@@ -1215,7 +1237,7 @@
return(FALSE);
}
-@@ -758,21 +951,25 @@
+@@ -758,21 +958,25 @@
ut_ad(lock);
ut_ad(rw_lock_validate(lock));
@@ -1242,7 +1264,7 @@
return(ret);
}
-@@ -801,16 +998,26 @@
+@@ -801,16 +1005,26 @@
count++;
@@ -1272,7 +1294,7 @@
} else {
putc('\n', stderr);
}
-@@ -822,7 +1029,9 @@
+@@ -822,7 +1036,9 @@
}
}
@@ -1282,7 +1304,7 @@
lock = UT_LIST_GET_NEXT(list, lock);
}
-@@ -847,10 +1056,18 @@
+@@ -847,10 +1063,18 @@
if ((rw_lock_get_writer(lock) != RW_LOCK_NOT_LOCKED)
|| (rw_lock_get_reader_count(lock) != 0)
@@ -1304,7 +1326,7 @@
} else {
putc('\n', stderr);
}
-@@ -909,14 +1126,18 @@
+@@ -909,14 +1133,18 @@
lock = UT_LIST_GET_FIRST(rw_lock_list);
while (lock != NULL) {
=== modified file 'microslow_innodb.patch'
--- microslow_innodb.patch 2009-02-18 06:34:28 +0000
+++ microslow_innodb.patch 2009-05-20 06:04:48 +0000
@@ -26,10 +26,11 @@
diff -r 04958490fc6d innobase/buf/buf0buf.c
--- a/innobase/buf/buf0buf.c Tue Feb 17 22:32:27 2009 -0800
+++ b/innobase/buf/buf0buf.c Tue Feb 17 22:33:00 2009 -0800
-@@ -37,6 +37,9 @@
+@@ -37,6 +37,10 @@
#include "log0log.h"
#include "trx0undo.h"
#include "srv0srv.h"
++#include "trx0trx.h"
+
+/* prototypes for new functions added to ha_innodb.cc */
+trx_t* innobase_get_trx();
@@ -541,11 +542,12 @@
diff -r 04958490fc6d innobase/os/os0file.c
--- a/innobase/os/os0file.c Tue Feb 17 22:32:27 2009 -0800
+++ b/innobase/os/os0file.c Tue Feb 17 22:33:00 2009 -0800
-@@ -14,6 +14,7 @@
+@@ -14,6 +14,8 @@
#include "srv0start.h"
#include "fil0fil.h"
#include "buf0buf.h"
+#include "trx0sys.h"
++#include "trx0trx.h"
#if defined(UNIV_HOTBACKUP) && defined(__WIN__)
/* Add includes for the _stat() call to compile on Windows */
References