diff options
| author | Uros Bizjak <[email protected]> | 2022-10-19 14:08:50 +0000 |
|---|---|---|
| committer | Peter Zijlstra <[email protected]> | 2022-10-27 08:35:41 +0000 |
| commit | d0c006402e7941558e5283ae434e2847c7999378 (patch) | |
| tree | b55cbec0a50b075fd546c6713d83d65f8b67d290 /net/ipv4/tcp_output.c | |
| parent | Linux 6.1-rc2 (diff) | |
| download | kernel-d0c006402e7941558e5283ae434e2847c7999378.tar.gz kernel-d0c006402e7941558e5283ae434e2847c7999378.zip | |
jump_label: Use atomic_try_cmpxchg() in static_key_slow_inc_cpuslocked()
Use atomic_try_cmpxchg() instead of atomic_cmpxchg (*ptr, old, new) ==
old in static_key_slow_inc_cpuslocked(). 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, atomic_try_cmpxchg() implicitly assigns old *ptr value to "old" when
cmpxchg fails, enabling further code simplifications.
No functional change intended.
Signed-off-by: Uros Bizjak <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'net/ipv4/tcp_output.c')
0 files changed, 0 insertions, 0 deletions
