diff options
| author | 2022-07-12 16:49:17 +0200 | |
|---|---|---|
| committer | 2022-09-11 21:55:06 -0700 | |
| commit | 4f1d2a030db09af4d21695983674a18633cd0ffb (patch) | |
| tree | b149575bb927d0552a63441ab885a5a9128212f3 /include/linux | |
| parent | panic, kexec: make __crash_kexec() NMI safe (diff) | |
| download | linux-dev-4f1d2a030db09af4d21695983674a18633cd0ffb.tar.xz linux-dev-4f1d2a030db09af4d21695983674a18633cd0ffb.zip | |
llist: use try_cmpxchg in llist_add_batch and llist_del_first
Use try_cmpxchg instead of cmpxchg (*ptr, old, new) == old in
llist_add_batch and llist_del_first. x86 CMPXCHG instruction returns
success in ZF flag, so this change saves a compare after cmpxchg.
Also, try_cmpxchg implicitly assigns old *ptr value to "old" when cmpxchg
fails, enabling further code simplifications.
No functional change intended.
Link: https://lkml.kernel.org/r/20220712144917.4497-1-ubizjak@gmail.com
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
