Ubuntu-focal-kernel/include/asm-generic
Linus Torvalds 0739f02aab asm-generic: qspinlock: fix queued_spin_value_unlocked() implementation
BugLink: https://bugs.launchpad.net/bugs/2051644

[ Upstream commit 125b0bb95dd6bec81b806b997a4ccb026eeecf8f ]

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 c6f4a9002252 ("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>
Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2024-02-02 14:13:21 +01:00
..
bitops locking/atomic: Make test_and_*_bit() ordered on failure 2022-10-17 15:01:52 +02:00
vdso lib/vdso: Make __arch_update_vdso_data() logic understandable 2020-03-06 14:05:58 +01:00
4level-fixup.h
5level-fixup.h
Kbuild
asm-offsets.h
asm-prototypes.h
atomic-instrumented.h
atomic-long.h
atomic.h
atomic64.h
audit_change_attr.h
audit_dir_write.h
audit_read.h
audit_signal.h
audit_write.h
barrier.h
bitops-instrumented.h
bitops.h
bitsperlong.h
bug.h
cache.h
cacheflush.h
checksum.h
cmpxchg-local.h
cmpxchg.h
compat.h
current.h
delay.h
device.h
div64.h
dma-contiguous.h
dma-mapping.h
dma.h
early_ioremap.h
emergency-restart.h
error-injection.h
exec.h
export.h
extable.h
fb.h
fixmap.h
flat.h
ftrace.h
futex.h
getorder.h
gpio.h
hardirq.h
hugetlb.h
hw_irq.h
ide_iops.h
int-ll64.h
io.h asm-generic/io.h: suppress endianness warnings for readq() and writeq() 2023-08-09 12:25:13 +02:00
ioctl.h
iomap.h
irq.h
irq_regs.h
irq_work.h
irqflags.h
kdebug.h
kmap_types.h
kprobes.h
kvm_para.h
linkage.h
local.h
local64.h
mcs_spinlock.h
memory_model.h
mm-arch-hooks.h
mm_hooks.h
mmiowb.h asm-generic/mmiowb: Allow mmiowb_set_pending() when preemptible() 2020-08-08 01:53:12 -04:00
mmiowb_types.h
mmu.h
mmu_context.h
module.h
mshyperv.h x86/Hyper-V: Report crash data in die() when panic_on_oops is set 2020-05-25 10:41:13 +02:00
msi.h
page.h
param.h
parport.h
pci.h
pci_iomap.h
percpu.h
pgalloc.h
pgtable-nop4d-hack.h
pgtable-nop4d.h
pgtable-nopmd.h
pgtable-nopud.h
pgtable.h arch: pgtable: define MAX_POSSIBLE_PHYSMEM_BITS where needed 2021-01-20 14:24:40 +01:00
preempt.h
qrwlock.h
qrwlock_types.h
qspinlock.h asm-generic: qspinlock: fix queued_spin_value_unlocked() implementation 2024-02-02 14:13:21 +01:00
qspinlock_types.h
resource.h
seccomp.h
sections.h asm-generic: sections: refactor memory_intersects 2022-10-17 15:02:18 +02:00
serial.h
set_memory.h
shmparam.h
signal.h
simd.h
spinlock.h
statfs.h
string.h
switch_to.h
syscall.h
syscalls.h
termios-base.h
termios.h
timex.h
tlb.h mm/khugepaged: fix GUP-fast interaction by sending IPI 2023-02-01 15:21:52 +01:00
tlbflush.h
topology.h include/asm-generic/topology.h: guard cpumask_of_node() macro argument 2020-06-22 17:23:33 -03:00
trace_clock.h
uaccess.h
unaligned.h
user.h
vga.h
vmlinux.lds.h arch: fix broken BuildID for arm64 and riscv 2023-07-10 17:21:41 +02:00
vtime.h
word-at-a-time.h word-at-a-time: use the same return type for has_zero regardless of endianness 2023-10-30 11:41:48 +01:00
xor.h