Description: Enable full memory barrier usage on AArch64 The fix for MDEV-7026 reworked a corruption fix for PowerPC using #ifdef __powerpc__ guards. AArch64 is also impacted by that corruption issue, so this introduced a regression. Follow suit by placing __aarch64__ in the guard as well. The author isn't a fan of using arch #ifdefs in this way, but he also isn't familiar enough with the code to rearchitect it. Author: dann frazier Bug-Ubuntu: https://bugs.launchpad.net/bugs/1427406 Forwarded: no Last-Update: 2015-03-30 Index: mysql-5.6/storage/innobase/include/os0sync.h =================================================================== --- mysql-5.6.orig/storage/innobase/include/os0sync.h +++ mysql-5.6/storage/innobase/include/os0sync.h @@ -464,7 +464,7 @@ amount to decrement. */ /**********************************************************//** Returns the old value of *ptr, atomically sets *ptr to new_val */ -#ifdef __powerpc__ +#if defined(__aarch64__) || defined(__powerpc__) /* os_atomic_test_and_set_byte_release() should imply a release barrier before setting, and a full barrier after. But __sync_lock_test_and_set() is only Index: mysql-5.6/storage/innobase/include/os0sync.ic =================================================================== --- mysql-5.6.orig/storage/innobase/include/os0sync.ic +++ mysql-5.6/storage/innobase/include/os0sync.ic @@ -73,7 +73,7 @@ os_fast_mutex_trylock_full_barrier( returns 1 on success (but MySQL remaps that to 0), while Linux, FreeBSD, Solaris, AIX, Tru64 Unix, HP-UX-11.0 return 0 on success. */ -#ifdef __powerpc__ +#if defined( __aarch64__) || defined(__powerpc__) os_mb; #endif return((ulint) pthread_mutex_trylock(mutex)); Index: mysql-5.6/storage/innobase/os/os0sync.cc =================================================================== --- mysql-5.6.orig/storage/innobase/os/os0sync.cc +++ mysql-5.6/storage/innobase/os/os0sync.cc @@ -902,7 +902,7 @@ os_fast_mutex_unlock_full_barrier_func( LeaveCriticalSection(fast_mutex); #else pthread_mutex_unlock(fast_mutex); -#ifdef __powerpc__ +#if defined(__aarch64__) || defined(__powerpc__) os_mb; #endif #endif