Hi, Peter, On Thu, Jul 29, 2021 at 4:24 PM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote: > > On Thu, Jul 29, 2021 at 09:58:02AM +0800, hev wrote: > > Hi, Peter, > > > > On Wed, Jul 28, 2021 at 9:21 PM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote: > > > > > > On Wed, Jul 28, 2021 at 03:16:54PM +0200, Peter Zijlstra wrote: > > > > On Wed, Jul 28, 2021 at 02:58:35PM +0200, Peter Zijlstra wrote: > > > > > The below isn't quite right, because it'll use try_cmpxchg() for > > > > > atomic_andnot_or(), which by being a void atomic should be _relaxed. I'm > > > > > not entirely sure how to make that happen in a hurry. > > > > > > > > > > --- > > > > > > > > This seems to do the trick. > > > > > > > > > > Mark suggested this, which is probably nicer still. > > Wow, Amazing! so the architecture dependent can be implemented one by one. > > Nah, this is just the fallback, you still need individual arch code to > optimize this and get proper LL/SC primitives. Okay, already started. If the atomic andnot_or seems to be ok, I will send the rest of the patches. Regards Rui