[MDEV-6654] Combine ib_mutex_t::waiters and ib_mutex_t::lock_word Created: 2014-08-28 Updated: 2016-10-17 Resolved: 2016-10-17 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Fix Version/s: | 10.2.3 |
| Type: | Task | Priority: | Major |
| Reporter: | Sergey Vojtovich | Assignee: | Sergey Vojtovich |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
lock_word is boolean: 0 - mutex unlocked, 1 - mutex_locked There are a few problems with maintaining these variables:
One of options would be to encode waiters into lock_word: Ideally mutex_enter() should create just one acquire memory barrier, mutex_exit() should create just one release memory barrier. One of possible options (neither tested nor benchmarked):
|
| Comments |
| Comment by Sergey Vojtovich [ 2014-11-26 ] |
|
MySQL 5.7 got new mutex implementation, which is totally different from current one. It has combined waiters and lock_word. At first glance code looks dead complex and not very optimal: still a bunch of full memory barriers etc. We'll need to postpone this task till we merge and test new implementation. |
| Comment by Sergey Vojtovich [ 2016-10-17 ] |
|
Fixed in |