Redundant wakeups in priority rw_lock_s_unlock_func()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS |
Fix Released
|
Medium
|
Laurynas Biveinis | ||
5.1 |
Invalid
|
Undecided
|
Unassigned | ||
5.5 |
Invalid
|
Undecided
|
Unassigned | ||
5.6 |
Fix Released
|
Medium
|
Laurynas Biveinis |
Bug Description
The current priority rw_lock_
if (lock_word == 0) {
/* A waiting next-writer exists, either high priority or
regular. Wake up the first waiter in this order: 1) high
priority next-writer; 2) high priority X waiters; 3) high
priority S waiters; 4) regular priority next-waiter. This
allows high priority requests to overtake an already-waiting
regular priority next-waiter. */
if (lock->
lock-
/* Note that we do not have a separate high priority
next-waiter event. There can be only one such waiter,
here we already know it's high priority, no
regular-priority wakeup may happen. */
os_event_
} else if (lock->
os_event_
} else if (lock->
os_event_
} else {
os_event_
}
sync_
It is impossible with the current implementation, contrary to what the 1st comment says, for a high-priority X or S waiter, to overtake a low-priority next-writer, as the current S unlock already results in X-locked lock word for the next-waiter, whatever its priority is. Thus the high_priority_
Related branches
- Alexey Kopytov (community): Approve
- Laurynas Biveinis: Pending requested
- Vlad Lesin: Pending (g2) requested
-
Diff: 345 lines (+82/-49)7 files modifiedPercona-Server/storage/innobase/include/sync0rw.h (+4/-4)
Percona-Server/storage/innobase/include/sync0rw.ic (+7/-25)
Percona-Server/storage/innobase/include/sync0sync.h (+5/-6)
Percona-Server/storage/innobase/include/sync0sync.ic (+0/-1)
Percona-Server/storage/innobase/sync/sync0arr.cc (+3/-3)
Percona-Server/storage/innobase/sync/sync0rw.cc (+45/-8)
Percona-Server/storage/innobase/sync/sync0sync.cc (+18/-2)
tags: | added: xtradb |
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/ /jira.percona. com/browse/ PS-1440