Re: [patch v2 04/11] uaccess: Provide unsafe_atomic_store_release_user()

From: André Almeida

Date: Fri Mar 20 2026 - 12:08:17 EST


Em 19/03/2026 20:24, Thomas Gleixner escreveu:
The upcoming support for unlocking robust futexes in the kernel requires
store release semantics. Syscalls do not imply memory ordering on all
architectures so the unlock operation requires a barrier.

This barrier can be avoided when stores imply release like on x86.

Provide a generic version with a smp_mb() before the unsafe_put_user(),
which can be overridden by architectures.

Provide also a ARCH_STORE_IMPLIES_RELEASE Kconfig option, which can be
selected by architectures where store implies release, so that the smp_mb()
in the generic implementation can be avoided.

Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>

Reviewed-by: André Almeida <andrealmeid@xxxxxxxxxx>