On Mon, 11 Mar 2019, Bj�rn T�pel wrote: > > > Hmm, you mean AMO *with* preempt_{dis,en}able, right? (No, interrupt > > > disable, only preemption.) > > > > If you disable preemption then you dont need AMO anymore. In fact that is > > the default fallback generic implementation. Just dont do anything and you > > already have that solution. > > But the generic one disables interrupts, right? No it doesnt. > I believe the rational for RV is similar to ARM's; AMO+preemption > disable regions is *slightly* better than the generic, but not as good > as the IA one. Or am I missing something?> Looks to me that the better solution for ARM may be to drop its implementation and revert to the generic one. The overhead of AMOs is likely too high to justify using those. And the LC/SC overhead is also generating useless overhead. If you benchmark those then please be aware that the kernel uses __this_xxx ops in places where the preempt disable is not needed. The savings come in the form of this_xxx ops where we avoid the overhead of enabling and disabling preemption (which can be significant especialy given the scheduler actions).