[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170407212626.59f68530@roar.ozlabs.ibm.com>
Date: Fri, 7 Apr 2017 21:26:26 +1000
From: Nicholas Piggin <npiggin@...il.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Will Deacon <will.deacon@....com>,
David Miller <davem@...emloft.net>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Anton Blanchard <anton@...ba.org>,
linuxppc-dev list <linuxppc-dev@...abs.org>
Subject: Re: [RFC][PATCH] spin loop arch primitives for busy waiting
On Fri, 7 Apr 2017 11:43:49 +0200
Peter Zijlstra <peterz@...radead.org> wrote:
> On Thu, Apr 06, 2017 at 10:31:46AM -0700, Linus Torvalds wrote:
> > But maybe "monitor" is really cheap. I suspect it's microcoded,
> > though, which implies "no".
>
> On my IVB-EP (will also try on something newer):
>
> MONITOR ~332 cycles
> MWAIT ~224 cycles (C0, explicitly invalidated MONITOR)
>
> So yes, expensive.
Interestingly, Intel optimization manual says:
The latency of PAUSE instruction in prior generation microarchitecture
is about 10 cycles, whereas on Skylake microarchitecture it has been
extended to as many as 140 cycles.
In another part this is claimed for efficiency improvement. Still much
cheaper than your monitor+mwait on your IVB but if skylake is a bit
faster it might become worth it.
Powered by blists - more mailing lists