linux-stable/include/asm-generic
Linus Torvalds 125b0bb95d asm-generic: qspinlock: fix queued_spin_value_unlocked() implementation
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>
2023-11-22 09:32:49 -08:00
..
bitops mm: delete checks for xor_unlock_is_negative_byte() 2023-10-18 14:34:17 -07:00
vdso
access_ok.h
agp.h char/agp: introduce asm-generic/agp.h 2023-02-13 22:13:29 +01:00
archrandom.h random: handle archrandom with multiple longs 2022-07-25 13:26:14 +02:00
asm-offsets.h
asm-prototypes.h
atomic.h locking/atomic: make atomic*_{cmp,}xchg optional 2023-06-05 09:57:14 +02:00
atomic64.h
audit_change_attr.h
audit_dir_write.h
audit_read.h
audit_signal.h
audit_write.h
barrier.h asm-generic: Add memory barrier dma_mb() 2022-06-23 18:34:58 +01:00
bitops.h
bitsperlong.h
bug.h panic: make function declarations visible 2023-06-09 17:44:15 -07:00
cache.h
cacheflush.h mm: rationalise flush_icache_pages() and flush_icache_page() 2023-08-24 16:20:25 -07:00
checksum.h
cmpxchg-local.h asm-generic: avoid __generic_cmpxchg_local warnings 2023-04-04 17:58:11 +02:00
cmpxchg.h asm-generic: avoid __generic_cmpxchg_local warnings 2023-04-04 17:58:11 +02:00
compat.h asm-generic: compat: fix compat_arg_u64() and compat_arg_u64_dual() 2022-11-01 10:20:11 +11:00
current.h asm-generic: current: Don't include thread-info.h if building asm 2023-08-26 22:38:49 +02:00
delay.h
device.h
div64.h
dma-mapping.h dma-mapping: no need to pass a bus_type into get_arch_dma_ops() 2023-02-15 12:35:20 +01:00
dma.h
early_ioremap.h
emergency-restart.h
error-injection.h docs: fault-injection: add requirements of error injectable functions 2023-02-02 22:50:00 -08:00
exec.h
export.h ia64,export.h: replace EXPORT_DATA_SYMBOL* with EXPORT_SYMBOL* 2023-06-22 21:21:06 +09:00
extable.h
fb.h fbdev: Replace fb_pgprotect() with pgprot_framebuffer() 2023-10-12 09:20:46 +02:00
fixmap.h
flat.h
ftrace.h
futex.h
getorder.h
hardirq.h
hugetlb.h mm: hugetlb: add huge page size param to set_huge_pte_at() 2023-09-29 17:20:47 -07:00
hw_irq.h
hyperv-tlfs.h x86/hyperv: Add smp support for SEV-SNP guest 2023-08-22 00:38:20 +00:00
int-ll64.h
io.h mm: ioremap: remove unneeded ioremap_allowed and iounmap_allowed 2023-08-18 10:12:36 -07:00
ioctl.h
iomap.h asm-generic/iomap.h: remove ARCH_HAS_IOREMAP_xx macros 2023-08-18 10:12:32 -07:00
irq.h
irq_regs.h
irq_work.h
irqflags.h
Kbuild asm-generic: Fix spelling of architecture 2023-10-06 22:30:22 +02:00
kdebug.h
kmap_size.h
kprobes.h
kvm_para.h
kvm_types.h
linkage.h
local.h locking/generic: Wire up local{,64}_try_cmpxchg() 2023-04-29 09:09:09 +02:00
local64.h locking/generic: Wire up local{,64}_try_cmpxchg() 2023-04-29 09:09:09 +02:00
logic_io.h
mcs_spinlock.h
memory_model.h mm, arch: add generic implementation of pfn_valid() for FLATMEM 2023-02-09 16:51:41 -08:00
mm_hooks.h
mmiowb.h
mmiowb_types.h
mmu.h
mmu_context.h
module.h
module.lds.h
mshyperv.h hyperv: reduce size of ms_hyperv_info 2023-09-22 20:28:16 +00:00
msi.h genirq: Get rid of GENERIC_MSI_IRQ_DOMAIN 2022-11-17 15:15:20 +01:00
nommu_context.h
numa.h
page.h asm-generic/page.h: Make pfn accessors static inlines 2023-05-29 11:27:08 +02:00
param.h
parport.h
pci.h asm-generic: Add new pci.h and use it 2022-07-22 17:34:57 -05:00
pci_iomap.h PCI: Stub __pci_ioport_map() for arches that don't support it at all 2022-07-29 12:01:00 -05:00
percpu.h percpu: Fix self-assignment of __old in raw_cpu_generic_try_cmpxchg() 2023-06-08 10:28:39 +02:00
pgalloc.h mm: add statistics for PUD level pagetable 2023-10-06 14:44:10 -07:00
pgtable-nop4d.h
pgtable-nopmd.h riscv/mm: fix two page table check related issues 2022-05-19 14:08:48 -07:00
pgtable-nopud.h
pgtable_uffd.h
preempt.h riscv: support PREEMPT_DYNAMIC with static keys 2023-08-31 00:18:34 -07:00
qrwlock.h asm-generic changes for 5.19 2022-05-26 10:50:30 -07:00
qrwlock_types.h locking/qrwlock: Change "queue rwlock" to "queued rwlock" 2022-05-11 16:27:04 +02:00
qspinlock.h asm-generic: qspinlock: fix queued_spin_value_unlocked() implementation 2023-11-22 09:32:49 -08:00
qspinlock_types.h
resource.h
rwonce.h
seccomp.h
sections.h asm-generic: sections: refactor memory_intersects 2022-08-28 14:02:45 -07:00
serial.h
set_memory.h
shmparam.h
signal.h asm-generic: Remove empty #ifdef SA_RESTORER 2022-09-10 09:56:53 +02:00
simd.h
softirq_stack.h asm-generic: Conditionally enable do_softirq_own_stack() via Kconfig. 2022-09-05 17:20:55 +02:00
spinlock.h asm-generic: ticket-lock: Optimize arch_spin_value_unlocked() 2023-09-21 10:17:00 +02:00
spinlock_types.h asm-generic: ticket-lock: New generic ticket-based spinlock 2022-05-11 11:49:38 -07:00
statfs.h
string.h
switch_to.h
syscall.h
syscalls.h
timex.h
tlb.h mm: add utility functions for ptdesc 2023-08-21 13:37:52 -07:00
tlbflush.h
topology.h
trace_clock.h
uaccess.h
unaligned.h asm-generic: make parameter types consistent in _unaligned_be48() 2022-09-11 21:55:12 -07:00
user.h
vermagic.h
vga.h
vmlinux.lds.h linux/init: remove __memexit* annotations 2023-10-28 21:31:22 +09:00
vtime.h
word-at-a-time.h word-at-a-time: use the same return type for has_zero regardless of endianness 2023-08-02 10:23:36 -07:00
xor.h