[Commits] Rev 4373: MDEV-7026 - Race in InnoDB/XtraDB mutex implementation can stall or hang the in lp:maria/5.5

Sergey Vojtovich svoj at mariadb.org
Fri Nov 21 13:32:16 EET 2014


At lp:maria/5.5

------------------------------------------------------------
revno: 4373
revision-id: svoj at mariadb.org-20141121112318-vf64uck0joarklb7
parent: jplindst at mariadb.org-20141121112736-domd6qm2oi9unudw
committer: Sergey Vojtovich <svoj at mariadb.org>
branch nick: 5.5
timestamp: Fri 2014-11-21 15:23:18 +0400
message:
  MDEV-7026 - Race in InnoDB/XtraDB mutex implementation can stall or hang the
              server
  
  This is an addition to original patch. Added full memory barrier to ensure
  proper StoreLoad order between waiters and lock_word on PPC64.
=== modified file 'storage/innobase/sync/sync0sync.c'
--- a/storage/innobase/sync/sync0sync.c	2014-11-19 12:56:46 +0000
+++ b/storage/innobase/sync/sync0sync.c	2014-11-21 11:23:18 +0000
@@ -593,6 +593,11 @@ mutex_spin_wait(
 
 	mutex_set_waiters(mutex, 1);
 
+	/* Make sure waiters store won't pass over mutex_test_and_set */
+#ifdef __powerpc__
+	os_mb;
+#endif
+
 	/* Try to reserve still a few times */
 	for (i = 0; i < 4; i++) {
 		if (mutex_test_and_set(mutex) == 0) {

=== modified file 'storage/xtradb/sync/sync0sync.c'
--- a/storage/xtradb/sync/sync0sync.c	2014-11-19 12:56:46 +0000
+++ b/storage/xtradb/sync/sync0sync.c	2014-11-21 11:23:18 +0000
@@ -588,6 +588,11 @@ mutex_spin_wait(
 
 	mutex_set_waiters(mutex, 1);
 
+	/* Make sure waiters store won't pass over mutex_test_and_set */
+#ifdef __powerpc__
+	os_mb;
+#endif
+
 	/* Try to reserve still a few times */
 	for (i = 0; i < 4; i++) {
 		if (mutex_test_and_set(mutex) == 0) {



More information about the commits mailing list