Re: [PATCH -tip] x86/locking/atomic: Use asm_inline for atomic locking insns

From: Peter Zijlstra
Date: Wed Mar 05 2025 - 14:40:22 EST


On Wed, Mar 05, 2025 at 07:04:08AM -1000, Linus Torvalds wrote:
> And honestly, none of that makes sense any more. You can't buy a UP
> machine any more, and the only UP case would be some silly minimal
> virtual environment, and if people really care about that minimal
> case, they should just compile the kernel without SMP support.
> Becxause UP has gone from being the default to being irrelevant. At
> least for x86-64.
>
> So I think we should just get rid of LOCK_PREFIX_HERE and the
> smp_locks section entirely.
>
> Which would probably obviate the need for your patch, since then the
> compiler wouldn't see it as some big instruction. But your patch isn't
> wrong, so this is absolutely not a NAK, more of a "we should go
> further".
>
> Hmm?

I'm all for removing that.

On that note, a number of architectures have already made the next step
and that is mandate SMP=y.

The down-side of that it that it would make a definite dent in the
compile coverage for SMP=n code -- but perhaps we have enough robots to
get away with that.