From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751231AbcFXStW (ORCPT ); Fri, 24 Jun 2016 14:49:22 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:56149 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750923AbcFXStV (ORCPT ); Fri, 24 Jun 2016 14:49:21 -0400 Date: Fri, 24 Jun 2016 20:48:57 +0200 From: Peter Zijlstra To: Davidlohr Bueso Cc: mingo@kernel.org, davem@davemloft.net, cw00.choi@samsung.com, dougthompson@xmission.com, bp@alien8.de, mchehab@osg.samsung.com, gregkh@linuxfoundation.org, pfg@sgi.com, jikos@kernel.org, hans.verkuil@cisco.com, awalls@md.metrocast.net, dledford@redhat.com, sean.hefty@intel.com, kys@microsoft.com, heiko.carstens@de.ibm.com, James.Bottomley@HansenPartnership.com, sumit.semwal@linaro.org, schwidefsky@de.ibm.com, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: Re: [PATCH v2 01/12] locking/atomic: Introduce inc/dec calls for FETCH-OP flavors Message-ID: <20160624184857.GD30154@twins.programming.kicks-ass.net> References: <1466453164-13185-1-git-send-email-dave@stgolabs.net> <1466453164-13185-2-git-send-email-dave@stgolabs.net> <20160621133310.GA24567@linux-80c1.suse> <20160621163611.GA3790@linux-80c1.suse> <20160623090942.GI30154@twins.programming.kicks-ass.net> <20160624163430.GA11823@linux-80c1.suse> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160624163430.GA11823@linux-80c1.suse> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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().