diff options
author | Oleg Nesterov <[email protected]> | 2014-12-01 22:34:17 +0100 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2014-12-08 11:36:44 +0100 |
commit | 78bff1c8684fb94f1ae7283688f90188b53fc433 (patch) | |
tree | 48795bcb348947f7e213980570e7413dfc10fc3d /tools/perf/util/scripting-engines/trace-event-python.c | |
parent | 9fd7fc34cfcaf9f6c932ee1710cce83da3b7bd59 (diff) |
x86/ticketlock: Fix spin_unlock_wait() livelock
arch_spin_unlock_wait() looks very suboptimal, to the point I
think this is just wrong and can lead to livelock: if the lock
is heavily contended we can never see head == tail.
But we do not need to wait for arch_spin_is_locked() == F. If it
is locked we only need to wait until the current owner drops
this lock. So we could simply spin until old_head !=
lock->tickets.head in this case, but .head can overflow and thus
we can't check "unlocked" only once before the main loop.
Also, the "unlocked" check can ignore TICKET_SLOWPATH_FLAG bit.
Signed-off-by: Oleg Nesterov <[email protected]>
Acked-by: Linus Torvalds <[email protected]>
Cc: Jeremy Fitzhardinge <[email protected]>
Cc: Paul E.McKenney <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Waiman Long <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
0 files changed, 0 insertions, 0 deletions