mariadb/storage/innobase
Sergey Vojtovich 1a1749e38c MDEV-11296 - InnoDB stalls under OLTP RW on P8
Threads may fall asleep forever while acquiring InnoDB rw-lock on Power8. This
regression was introduced along with InnoDB atomic operations fixes.

The problem was that proper memory order wasn't enforced between "writers"
store and "lock_word" load:

  my_atomic_store32((int32*) &lock->waiters, 1);
  ...
  local_lock_word = lock->lock_word;

Locking protocol is such that store to "writers" must be completed before load
of "lock_word". my_atomic_store32() was expected to enforce memory order because
it issues strongest MY_MEMORY_ORDER_SEQ_CST memory barrier.

According to C11:
- any operation with this memory order is both an acquire operation and a
  release operation
- for atomic store order must be one of memory_order_relaxed
  memory_order_release or memory_order_seq_cst. Otherwise the behavior is
  undefined.

That is it doesn't say explicitly that this expectation is wrong, but there are
indications that acquire (which is actually supposed to guarantee memory order
in this case) may not be issued along with MY_MEMORY_ORDER_SEQ_CST.

A good fix for this is to encode waiters into lock_word, but it is a bit too
intrusive. Instead we change atomic store to atomic fetch-and-store, which
does memory load and is guaranteed to issue acquire.
2016-11-25 12:41:35 +04:00
..
api MDEV-10813 - Clean-up InnoDB atomics, memory barriers and mutexes 2016-10-17 18:35:48 +04:00
btr MDEV-10813 - Clean-up InnoDB atomics, memory barriers and mutexes 2016-10-17 18:35:48 +04:00
buf Bug#23631471 BUF_BLOCK_ALIGN() MAKES INCORRECT ASSUMPTIONS ABOUT CHUNK SIZE 2016-11-02 12:29:41 +04:00
data Merge InnoDB 5.7 from mysql-5.7.14. 2016-09-08 15:49:03 +03:00
dict MDEV-10813 - Clean-up InnoDB atomics, memory barriers and mutexes 2016-10-17 18:35:48 +04:00
eval Merge InnoDB 5.7 from mysql-5.7.9. 2016-09-02 13:22:28 +03:00
fil Remove a bunch of TODO's, fix perfschema.threads_innodb test 2016-09-11 10:57:05 +02:00
fsp Merge InnoDB 5.7 from mysql-5.7.14. 2016-09-08 15:49:03 +03:00
fts Fix crash on innodb_fts.innobase_drop_fts_index_table 2016-09-14 15:11:01 +03:00
fut Merge InnoDB 5.7 from mysql-5.7.9. 2016-09-02 13:22:28 +03:00
gis Remove a bunch of TODO's, fix perfschema.threads_innodb test 2016-09-11 10:57:05 +02:00
ha Merge InnoDB 5.7 from mysql-5.7.9. 2016-09-02 13:22:28 +03:00
handler Merge pull request #255 from rasmushoj/MDEV-9820 2016-11-07 10:25:49 +02:00
ibuf MDEV-10813 - Clean-up InnoDB atomics, memory barriers and mutexes 2016-10-17 18:35:48 +04:00
include MDEV-11296 - InnoDB stalls under OLTP RW on P8 2016-11-25 12:41:35 +04:00
lock MDEV-10692: InnoDB: Failing assertion: lock->trx->lock.wait_lock == lock 2016-11-09 15:17:55 +02:00
log MDEV-10813 - Clean-up InnoDB atomics, memory barriers and mutexes 2016-10-17 18:35:49 +04:00
mach Merge InnoDB 5.7 from mysql-5.7.9. 2016-09-02 13:22:28 +03:00
mem Merge InnoDB 5.7 from mysql-5.7.9. 2016-09-02 13:22:28 +03:00
mtr Merge InnoDB 5.7 from mysql-5.7.14. 2016-09-08 15:49:03 +03:00
mysql-test/storage_engine Follow-up for MDEV-6720 (enable connection log in mysqltest by default) 2016-06-19 20:30:03 +03:00
os MDEV-10813 - Clean-up InnoDB atomics, memory barriers and mutexes 2016-10-17 18:35:49 +04:00
page MDEV-10727: Merge 5.7 Innochecksum with 5.6 2016-09-30 08:08:19 +03:00
pars Merge InnoDB 5.7 from mysql-5.7.14. 2016-09-08 15:49:03 +03:00
que Merge InnoDB 5.7 from mysql-5.7.14. 2016-09-08 15:49:03 +03:00
read Merge InnoDB 5.7 from mysql-5.7.9. 2016-09-02 13:22:28 +03:00
rem Merge InnoDB 5.7 from mysql-5.7.14. 2016-09-08 15:49:03 +03:00
row MDEV-11296 - InnoDB stalls under OLTP RW on P8 2016-11-25 12:41:35 +04:00
srv MDEV-11250: mtflush threads stall on shutdown 2016-11-10 09:42:49 +02:00
sync MDEV-11296 - InnoDB stalls under OLTP RW on P8 2016-11-25 12:41:35 +04:00
trx Change all space indentions to tab. 2016-10-23 13:36:26 -04:00
usr Merge InnoDB 5.7 from mysql-5.7.9. 2016-09-02 13:22:28 +03:00
ut InnoDB cleanups 2016-11-15 14:56:29 +04:00
CMakeLists.txt MDEV-11195: Simplify enablement of NUMA in innodb/xtradb 2016-11-02 14:37:43 +11:00
compile-innodb move to storage/innobase 2015-05-04 19:17:21 +02:00
COPYING.Google move to storage/innobase 2015-05-04 19:17:21 +02:00
COPYING.Percona move to storage/innobase 2015-05-04 19:17:21 +02:00
innodb.cmake MDEV-10813 - Clean-up InnoDB atomics, memory barriers and mutexes 2016-10-17 18:35:49 +04:00
plugin_exports Solaris compilation failure: xtradb is linked in statically, ha_innodb.so needs 2014-05-01 14:05:52 +02:00