perf/x86/rapl: Stop doing cpu_relax() in the local64_cmpxchg() loop in rapl_event_upd...
authorUros Bizjak <ubizjak@gmail.com>
Mon, 7 Aug 2023 14:51:14 +0000 (16:51 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 3 Oct 2023 19:13:23 +0000 (21:13 +0200)
commit1ce19bf90bd55bf54f9ed75d594029db63d395b0
treed31c6e817c98c5ef749295fb146b1b7e16b0a084
parentde80193308f43d3ae52cd3561e8ba77cd1437311
perf/x86/rapl: Stop doing cpu_relax() in the local64_cmpxchg() loop in rapl_event_update()

According to the following commit:

   f5fe24ef17b5 ("lockref: stop doing cpu_relax in the cmpxchg loop")

   "On the x86-64 architecture even a failing cmpxchg grants exclusive
    access to the cacheline, making it preferable to retry the failed op
    immediately instead of stalling with the pause instruction."

Based on the above observation, remove cpu_relax() from the
local64_cmpxchg() loop of rapl_event_update().

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Link: https://lore.kernel.org/r/20230807145134.3176-1-ubizjak@gmail.com
arch/x86/events/rapl.c