[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1466786765.2343.37.camel@HansenPartnership.com>
Date: Fri, 24 Jun 2016 09:46:05 -0700
From: James Bottomley <James.Bottomley@...senPartnership.com>
To: Davidlohr Bueso <dave@...olabs.net>, peterz@...radead.org,
mingo@...nel.org
Cc: 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, sumit.semwal@...aro.org,
schwidefsky@...ibm.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH -tip 00/12] locking/atomics: Add and use inc,dec calls
for FETCH-OP flavors
On Mon, 2016-06-20 at 13:05 -0700, Davidlohr Bueso wrote:
> Hi,
>
> The series is really straightforward and based on Peter's work that
> introduces[1] the atomic_fetch_$op machinery. Only patch 1 implements
> the actual atomic_fetch_{inc,dec} calls based on
> atomic_fetch_{add,sub}.
Could I just ask why? atomic_inc_return(x) - 1 seems a reasonable
thing to do to me. Is it because on architectures where atomics are
implemented in asm, it costs us one more CPU instruction to do the
extra decrement which gcc can't optimise? If that's it, I'm not sure
the added complexity justifies the cycle savings.
James
Powered by blists - more mailing lists