On Thu, 21 Feb 2019, Björn Töpel wrote: > On Thu, 21 Feb 2019 at 17:28, Paul Walmsley wrote: > > > > On Wed, 20 Feb 2019, Björn Töpel wrote: > > > > > Christopher mentioned "per-cpu atomicity" in his Plumbers RISC-V HPC > > > talk [1]. Typically, this would be for the per-cpu implementation in > > > Linux, so I had a look at the current implementation. > > > > > > I noticed that RISC-V currently uses the generic one. Has there been > > > any work on moving to a RISC-V specific impl, based on the > > > A-extensions, similar to what aarch64 does? Would that make sense? > > > > Yes doing a RISC-V implementation with the AMO instructions would make > > sense. Care to take that on? > > > > Yeah, I'll take a stab at it! I guess AMO is in general favored over > the LL/SC path, correct? Yes. I think our current plan is to only support cores with the A-extension in upstream Linux. Between LR/SC and atomics, the atomics would be preferred. As Christoph wrote, using an atomic add avoids the fail/retry risk inherent in an LR/SC sequence, and is easier to optimize in microarchitecture. - Paul