From: Nicholas Piggin
> Sent: 04 August 2017 10:04
> On Fri, 04 Aug 2017 11:40:43 +1000
> Benjamin Herrenschmidt wrote:
>
> > On Fri, 2017-08-04 at 03:50 +1000, Nicholas Piggin wrote:
> > > Hey, so... why are any of these implemented in asm? We should
> > > just do them all in C, right? I looked
On Fri, 04 Aug 2017 11:40:43 +1000
Benjamin Herrenschmidt wrote:
> On Fri, 2017-08-04 at 03:50 +1000, Nicholas Piggin wrote:
> > Hey, so... why are any of these implemented in asm? We should
> > just do them all in C, right? I looked a bit harder at code gen
> > and a couple of them are still emi
On Fri, 2017-08-04 at 03:50 +1000, Nicholas Piggin wrote:
> Hey, so... why are any of these implemented in asm? We should
> just do them all in C, right? I looked a bit harder at code gen
> and a couple of them are still emitting larx/stcx.
As long as we can guarantee that the C compiler won't pla
On Thu, 3 Aug 2017 09:19:18 +0530
Madhavan Srinivasan wrote:
> @@ -14,6 +17,202 @@ typedef struct
> #define local_read(l)atomic_long_read(&(l)->a)
> #define local_set(l,i) atomic_long_set(&(l)->a, (i))
>
> +#ifdef CONFIG_PPC64
> +
> +static __inline__ void local_add(long i, loc
Local atomic operations are fast and highly reentrant per CPU counters.
Used for percpu variable updates. Local atomic operations only guarantee
variable modification atomicity wrt the CPU which owns the data and
these needs to be executed in a preemption safe way.
Here is the design of this patch