Re: [PATCH] spin loop primitives for busy waiting

2017-05-12 Thread Nicholas Piggin
On Fri, 12 May 2017 12:58:12 + David Laight wrote: > From: Linus Torvalds > > Sent: 11 May 2017 19:48 > ... > > The one question I have is about "spin_on_cond()": since you > > explicitly document that the "no spinning" case is expected to be the > > default, I

Re: [PATCH] spin loop primitives for busy waiting

2017-05-12 Thread Linus Torvalds
On Fri, May 12, 2017 at 5:58 AM, David Laight wrote: > > At least some versions of gcc convert while (cond) do {body} > into if (cond) do {body} while (cond) even when 'cond' > is a non-trivial expression and 'body' is trivial. Afaik pretty much all versions of gcc do

RE: [PATCH] spin loop primitives for busy waiting

2017-05-12 Thread David Laight
From: Linus Torvalds > Sent: 11 May 2017 19:48 ... > The one question I have is about "spin_on_cond()": since you > explicitly document that the "no spinning" case is expected to be the > default, I really think that the default implementation should be > along the lines if > > #define

Re: [PATCH] spin loop primitives for busy waiting

2017-05-11 Thread Nicholas Piggin
On Thu, 11 May 2017 11:47:47 -0700 Linus Torvalds wrote: > On Thu, May 11, 2017 at 9:57 AM, Nicholas Piggin wrote: > > > > If you find this acceptable, I'd like to start wiring in the powerpc > > and adding the annotations to some important core

Re: [PATCH] spin loop primitives for busy waiting

2017-05-11 Thread Linus Torvalds
On Thu, May 11, 2017 at 9:57 AM, Nicholas Piggin wrote: > > If you find this acceptable, I'd like to start wiring in the powerpc > and adding the annotations to some important core spin loops (there's > not too many really). I'm hoping if you take this patch during this > merge