diff options
author | Matthew Wilcox <[email protected]> | 2018-08-20 10:19:14 -0400 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2018-10-02 09:49:42 +0200 |
commit | 27df89689e257cccb604fdf56c91a75a25aa554a (patch) | |
tree | 783e97bf76ae8c269f28e59f21ec62c6dc3dfa3f /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | cb92173d1f0474784c6171a9d3fdbbca0ee53554 (diff) |
locking/spinlocks: Remove an instruction from spin and write locks
Both spin locks and write locks currently do:
f0 0f b1 17 lock cmpxchg %edx,(%rdi)
85 c0 test %eax,%eax
75 05 jne [slowpath]
This 'test' insn is superfluous; the cmpxchg insn sets the Z flag
appropriately. Peter pointed out that using atomic_try_cmpxchg_acquire()
will let the compiler know this is true. Comparing before/after
disassemblies show the only effect is to remove this insn.
Take this opportunity to make the spin & write lock code resemble each
other more closely and have similar likely() hints.
Suggested-by: Peter Zijlstra <[email protected]>
Signed-off-by: Matthew Wilcox <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Acked-by: Will Deacon <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Thomas Gleixner <[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/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions