diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2014-07-18 15:16:25 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2014-07-18 15:16:25 +0400 |
commit | c0ebb3f38811c6a0e3e2b49b3ae40b4ea0c2b0e9 (patch) | |
tree | 23d5da9987c8c289715972a939ee1e9595bfc8f2 /storage/xtradb/include/sync0sync.ic | |
parent | c599cc6c0396ce7ef984ab751d95ad142becd84c (diff) | |
download | mariadb-git-c0ebb3f38811c6a0e3e2b49b3ae40b4ea0c2b0e9.tar.gz |
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.ic | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/storage/xtradb/include/sync0sync.ic b/storage/xtradb/include/sync0sync.ic index c3529af5262..d6922da7852 100644 --- a/storage/xtradb/include/sync0sync.ic +++ b/storage/xtradb/include/sync0sync.ic @@ -111,10 +111,7 @@ mutex_reset_lock_word( ib_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; |