[PATCH] riscv: support CPUs having only "zalrsc" but no "zaamo"
Linus Torvalds
torvalds at linux-foundation.org
Mon Jan 19 09:40:36 PST 2026
On Mon, 19 Jan 2026 at 09:17, Gary Guo <gary at garyguo.net> wrote:
>
> I'd be curious to know if any kind of performance evaluation has been done.
> atomic_inc is quite heavily used in the kernel.
LR/SC isn't generally a huge problem in itself - the problem is
typically that it requires a somewhat smart cache coherency to not get
into nasty "almost livelock" situations where heavy contention can
make things very unfair, and while the system on the whole makes
progress, some cores may end up starved.
That typically isn't seen unless you have lots of cores, though.
Of course, any CPU design that then left out AMO instructions in the
name of simplicity, probably *also* didn't put a lot of effort into
making the cache coherency have any kind of fairness guarantees.
So the platform is probably garbage for various other reasons.
Linus
More information about the linux-riscv
mailing list