linux/arch
Uros Bizjak 890a0794b3 x86/ACPI/boot: Use try_cmpxchg() in __acpi_{acquire,release}_global_lock()
Use try_cmpxchg instead of cmpxchg (*ptr, old, new) == old in
__acpi_{acquire,release}_global_lock().  x86 CMPXCHG instruction returns
success in ZF flag, so this change saves a compare after CMPXCHG
(and related MOV 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.

Note that the value from *ptr should be read using READ_ONCE() to prevent
the compiler from merging, refetching or reordering the read.

No functional change intended.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/20230116162522.4072-1-ubizjak@gmail.com
2023-01-26 11:49:40 +01:00
..
alpha
arc
arm ARM: SoC DT and driver fixes 6.2 2023-01-20 11:00:03 -08:00
arm64 ARM: SoC DT and driver fixes 6.2 2023-01-20 11:00:03 -08:00
csky
hexagon
ia64 elfcore: Add a cprm parameter to elf_core_extra_{phdrs,data_size} 2023-01-05 15:12:12 +00:00
loongarch LoongArch: Add generic ex-handler unwind in prologue unwinder 2023-01-17 11:42:16 +08:00
m68k m68k: remove broken strcmp implementation 2022-12-21 08:56:43 -08:00
microblaze
mips of/fdt: run soc memory setup when early_init_dt_scan_memory fails 2023-01-03 18:41:01 -06:00
nios2
openrisc
parisc parisc architecture fixes for kernel v6.2-rc1: 2022-12-20 08:43:53 -06:00
powerpc powerpc fixes for 6.2 #3 2023-01-15 07:09:41 -06:00
riscv ARM: SoC DT and driver fixes 6.2 2023-01-20 11:00:03 -08:00
s390 s390: workaround invalid gcc-11 out of bounds read warning 2023-01-17 19:00:59 +01:00
sh sh/mm: Fix pmd_t for real 2023-01-10 05:31:42 -06:00
sparc
um
x86 x86/ACPI/boot: Use try_cmpxchg() in __acpi_{acquire,release}_global_lock() 2023-01-26 11:49:40 +01:00
xtensa xtensa: drop unused members of struct thread_struct 2023-01-06 23:33:11 -08:00
.gitignore
Kconfig