[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160624184857.GD30154@twins.programming.kicks-ass.net>
Date: Fri, 24 Jun 2016 20:48:57 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Davidlohr Bueso <dave@...olabs.net>
Cc: mingo@...nel.org, davem@...emloft.net, cw00.choi@...sung.com,
dougthompson@...ssion.com, bp@...en8.de, mchehab@....samsung.com,
gregkh@...uxfoundation.org, pfg@....com, jikos@...nel.org,
hans.verkuil@...co.com, awalls@...metrocast.net,
dledford@...hat.com, sean.hefty@...el.com, kys@...rosoft.com,
heiko.carstens@...ibm.com, James.Bottomley@...senPartnership.com,
sumit.semwal@...aro.org, schwidefsky@...ibm.com,
linux-kernel@...r.kernel.org, Davidlohr Bueso <dbueso@...e.de>
Subject: Re: [PATCH v2 01/12] locking/atomic: Introduce inc/dec calls for
FETCH-OP flavors
On Fri, Jun 24, 2016 at 09:34:30AM -0700, Davidlohr Bueso wrote:
> On Thu, 23 Jun 2016, Peter Zijlstra wrote:
>
> >-
> >/* atomic_fetch_inc_relaxed */
> >#ifndef atomic_fetch_inc_relaxed
> >+
> >+#ifndef atomic_fetch_inc
>
> #define atomic_fetch_inc(v) (atomic_fetch_add(1, v))
Ah yes.
> >+#define atomic_fetch_inc_relaxed(v) atomic_fetch_add_relaxed(1, (v))
> >+#define atomic_fetch_inc_acquire(v) atomic_fetch_add_acquire(1, (v))
> >+#define atomic_fetch_inc_release(v) atomic_fetch_add_release(1, (v))
>
> I was under the impression that if the archs don't define their own calls,
> then we always default to fully ordered. Which is why I based all this ifdefery
> on what is currently done with the other atomic_fetch_$ops.
Right, but this allows an arch to only define atomic_fetch_add_relaxed()
and have the various forms of fetch_inc() instantiated as well.
With your earlier version they would all fall back to the fully
sequential variant of fetch_add().
Powered by blists - more mailing lists