HomeFreeBSD

x86 atomics: use lock prefix unconditionally

Description

x86 atomics: use lock prefix unconditionally

Atomics have significant other use besides providing in-system
primitives for safe memory updates. They are used for implementing
communication with out of system software or hardware following some
protocols.

For instance, even UP kernel might require a protocol using atomics to
communicate with the software-emulated device on SMP hypervisor. Or
real hardware might need atomic accesses as part of the proper
management protocol.

Another point is that UP configurations on x86 are extinct, so slight
performance hit by unconditionally use proper atomics is not important.
It is compensated by less code clutter, which in fact improves the
UP/i386 lifetime expectations.

Requested by: Elliott Mitchell <ehem+freebsd@m5p.com>
Reviewed by: Elliott Mitchell, imp, jhb, markj, royger
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D34153

Details

Provenance
kibAuthored on Feb 3 2022, 9:51 AM
Reviewer
imp
Differential Revision
D34153: x86 atomics: use lock prefix unconditionally
Parents
rGcbf999e75d61: x86 atomic.h: cleanup comments for preprocessor directives
Branches
Unknown
Tags
Unknown