diff options
| author | Heiko Carstens <hca@linux.ibm.com> | 2026-05-08 17:02:48 +0200 |
|---|---|---|
| committer | Alexander Gordeev <agordeev@linux.ibm.com> | 2026-05-20 09:48:04 +0200 |
| commit | 44e5edace5a0d79afa75db09b64746345d26d435 (patch) | |
| tree | 763670c647b0fd6b3d6d45d201d000acbaa5791a /scripts | |
| parent | 24b3afcff416ff502042c49101e83e6e7e29e989 (diff) | |
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>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
