Re: [patch V3 06/14] x86: Select ARCH_MEMORY_ORDER_TOS

From: Mark Rutland

Date: Mon Mar 30 2026 - 09:47:33 EST


On Mon, Mar 30, 2026 at 02:02:31PM +0200, Thomas Gleixner wrote:
> The generic unsafe_atomic_store_release_user() implementation does:
>
> if (!IS_ENABLED(CONFIG_ARCH_MEMORY_ORDER_TOS))
> smp_mb();
> unsafe_put_user();
>
> As x86 implements Total Store Order (TOS) which means stores imply release,
> select ARCH_MEMORY_ORDER_TOS to avoid the unnecessary smp_mb().
>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
> Reviewed-by: André Almeida <andrealmeid@xxxxxxxxxx>
> ---
> V3: Rename to TOS - Peter

As on the last patch, shouldn't that be TSO?

Mark

> V2: New patch
> ---
> arch/x86/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -114,6 +114,7 @@ config X86
> select ARCH_HAS_ZONE_DMA_SET if EXPERT
> select ARCH_HAVE_NMI_SAFE_CMPXCHG
> select ARCH_HAVE_EXTRA_ELF_NOTES
> + select ARCH_MEMORY_ORDER_TOS
> select ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE
> select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI
> select ARCH_MIGHT_HAVE_PC_PARPORT
>