linux/arch/s390/include/asm/vdso
Heiko Carstens 44e5edace5 s390/processor: Implement cpu_relax() with cpu serialization
There are many loops in the form of

        while (READ_ONCE(*somelocation))
                cpu_relax();

Strictly speaking the architecture requires serialization instead of only a
compiler barrier in the loop so the READ_ONCE() will see an updated value.

However real hardware does not require this (see IBM z Systems Processor
Optimization Primer - FAQ [1]), but it is still recommended to add
serialization. Given that cpu_relax() is doing nothing useful, it does
not hurt to add the single and fast instruction which makes sure that
serialization happens, and such loops may be left a bit faster.

[1] https://community.ibm.com/community/user/viewdocument/microprocessor-optimization-primer

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
2026-05-20 09:48:04 +02:00
..
clocksource.h s390: convert to GENERIC_VDSO 2020-08-26 18:47:21 +02:00
getrandom.h s390: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-06-16 16:23:02 +02:00
gettimeofday.h s390/time: Remove in-kernel time steering 2025-07-21 12:41:55 +02:00
processor.h s390/processor: Implement cpu_relax() with cpu serialization 2026-05-20 09:48:04 +02:00
time_data.h s390/time: Remove in-kernel time steering 2025-07-21 12:41:55 +02:00
vsyscall.h s390: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-06-16 16:23:02 +02:00