summaryrefslogtreecommitdiff
path: root/storage/xtradb/include/sync0sync.ic
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2014-08-29 16:02:46 +0400
committerSergey Vojtovich <svoj@mariadb.org>2014-08-29 16:02:46 +0400
commit40497577ffd9f85557b15e08ad913f627b2e9530 (patch)
tree75b05e459981227e225f0ebcd21288c3b7cf8e7b /storage/xtradb/include/sync0sync.ic
parentdd25e7f0ad002c79a8d9768f9d824e79800fb88d (diff)
downloadmariadb-git-40497577ffd9f85557b15e08ad913f627b2e9530.tar.gz
Backport from 10.0:
MDEV-6450 - MariaDB crash on Power8 when built with advance tool chain InnoDB mutex_exit() function calls __sync_test_and_set() to release the lock. According to manual this function is supposed to create "acquire" memory barrier whereas in fact we need "release" memory barrier at mutex_exit(). The problem isn't repeatable with gcc because it creates "acquire-release" memory barrier for __sync_test_and_set(). ATC creates just "acquire" barrier. Fixed by creating proper barrier at mutex_exit() by using __sync_lock_release() instead of __sync_test_and_set().
Diffstat (limited to 'storage/xtradb/include/sync0sync.ic')
-rw-r--r--storage/xtradb/include/sync0sync.ic5
1 files changed, 1 insertions, 4 deletions
diff --git a/storage/xtradb/include/sync0sync.ic b/storage/xtradb/include/sync0sync.ic
index acc389bfad9..de168964221 100644
--- a/storage/xtradb/include/sync0sync.ic
+++ b/storage/xtradb/include/sync0sync.ic
@@ -109,10 +109,7 @@ mutex_reset_lock_word(
mutex_t* mutex) /*!< in: mutex */
{
#if defined(HAVE_ATOMIC_BUILTINS)
- /* In theory __sync_lock_release should be used to release the lock.
- Unfortunately, it does not work properly alone. The workaround is
- that more conservative __sync_lock_test_and_set is used instead. */
- os_atomic_test_and_set_byte(&mutex->lock_word, 0);
+ os_atomic_lock_release_byte(&mutex->lock_word);
#else
mutex->lock_word = 0;