Commit 4472a0ef authored by Sergey Vojtovich's avatar Sergey Vojtovich

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.
parent b0febdb6
...@@ -593,6 +593,11 @@ mutex_spin_wait( ...@@ -593,6 +593,11 @@ mutex_spin_wait(
mutex_set_waiters(mutex, 1); 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 */ /* Try to reserve still a few times */
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (mutex_test_and_set(mutex) == 0) { if (mutex_test_and_set(mutex) == 0) {
......
...@@ -588,6 +588,11 @@ mutex_spin_wait( ...@@ -588,6 +588,11 @@ mutex_spin_wait(
mutex_set_waiters(mutex, 1); 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 */ /* Try to reserve still a few times */
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (mutex_test_and_set(mutex) == 0) { if (mutex_test_and_set(mutex) == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment