diff options
author | Uros Bizjak <[email protected]> | 2023-08-07 16:51:15 +0200 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2023-10-03 21:13:45 +0200 |
commit | bcc6ec3d954bbcc8bec34a21c05ea536a2e96d6f (patch) | |
tree | cf909666dfcc86ec6ec2c583c4db4cd5696264fe /tools/perf/scripts/python | |
parent | 1ce19bf90bd55bf54f9ed75d594029db63d395b0 (diff) |
perf/x86/rapl: Use local64_try_cmpxchg in rapl_event_update()
Use local64_try_cmpxchg() instead of local64_cmpxchg(*ptr, old, new) == old.
X86 CMPXCHG instruction returns success in ZF flag, so this change saves a
compare after CMPXCHG (and related move instruction in front of CMPXCHG).
Also, try_cmpxchg() implicitly assigns old *ptr value to "old" when CMPXCHG
fails. There is no need to re-read the value in the loop.
No functional change intended.
Signed-off-by: Uros Bizjak <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions