linux-stable/include
Linus Torvalds 09c8ee5f9b asm-generic: qspinlock: fix queued_spin_value_unlocked() implementation
[ Upstream commit 125b0bb95d ]

We really don't want to do atomic_read() or anything like that, since we
already have the value, not the lock.  The whole point of this is that
we've loaded the lock from memory, and we want to check whether the
value we loaded was a locked one or not.

The main use of this is the lockref code, which loads both the lock and
the reference count in one atomic operation, and then works on that
combined value.  With the atomic_read(), the compiler would pointlessly
spill the value to the stack, in order to then be able to read it back
"atomically".

This is the qspinlock version of commit c6f4a90022 ("asm-generic:
ticket-lock: Optimize arch_spin_value_unlocked()") which fixed this same
bug for ticket locks.

Cc: Guo Ren <guoren@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Waiman Long <longman@redhat.com>
Link: https://lore.kernel.org/all/CAHk-=whNRv0v6kQiV5QO6DJhjH4KEL36vWQ6Re8Csrnh4zbRkQ@mail.gmail.com/
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-12-20 15:44:35 +01:00
..
acpi ACPI: APEI: explicit init of HEST and GHES in apci_init() 2023-09-19 12:20:28 +02:00
asm-generic asm-generic: qspinlock: fix queued_spin_value_unlocked() implementation 2023-12-20 15:44:35 +01:00
clocksource
crypto crypto: api - Use work queue in crypto_destroy_instance 2023-09-19 12:20:08 +02:00
drm drm/connector: Add support for out-of-band hotplug notification (v3) 2023-10-25 11:54:22 +02:00
dt-bindings dt-bindings: iio: add AD74413R 2023-08-26 15:26:47 +02:00
keys
kunit
kvm
linux cred: switch to using atomic_long_t 2023-12-20 15:44:30 +01:00
math-emu
media media: v4l2-mem2mem: add lock to protect parameter num_rdy 2023-08-26 15:26:44 +02:00
memory
misc
net net: ipv6: support reporting otherwise unknown prefix flags in RTM_NEWPREFIX 2023-12-20 15:44:27 +01:00
pcmcia
ras
rdma RDMA/cma: Always set static rate to 0 for RoCE 2023-06-21 15:45:39 +02:00
scsi scsi: core: Introduce the scsi_cmd_to_rq() function 2023-12-08 08:46:15 +01:00
soc firmware: raspberrypi: Introduce devm_rpi_firmware_get() 2023-05-17 11:48:02 +02:00
sound ASoC: soc-card: Add storage for PCI SSID 2023-11-28 16:54:51 +00:00
target scsi: target: Fix multiple LUN_RESET handling 2023-05-17 11:47:48 +02:00
trace neighbor: tracing: Move pin6 inside CONFIG_IPV6=y section 2023-10-25 11:54:20 +02:00
uapi perf/core: Add a new read format to get a number of lost samples 2023-12-13 18:27:04 +01:00
vdso
video
xen ACPI: processor: Fix evaluating _PDC method when running as Xen dom0 2023-05-17 11:47:42 +02:00