[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFwgNhF=QUKMKLc9TfQ=cgF2mvMEVx9hJms4wQqCsib9Rw@mail.gmail.com>
Date: Thu, 6 Apr 2017 08:16:19 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Will Deacon <will.deacon@....com>
Cc: Nicholas Piggin <npiggin@...il.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>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [RFC][PATCH] spin loop arch primitives for busy waiting
On Thu, Apr 6, 2017 at 7:13 AM, Will Deacon <will.deacon@....com> wrote:
>
> We've wrapped this up in the arm64 code as __cmpwait, and we use that
> to build smp_cond_load_acquire. It would be nice to use the same machinery
> for the conditional spinning here, unless you anticipate that we're only
> going to be spinning for a handful of iterations anyway?
I suspect most of these loops aren't set up for the WFE kind of
spinning, because they look for more than one variable.
.. and the ones that _are_ set up for this probably should just be
rewritten to use smp_cond_load_acquire() anyway, because the "wait for
value" special case is fairly special.
In theory x86 could use monitor/mwait for it too, in practice I think
it tends to still be too high latency (because it was originally just
designed for the idle loop). mwait got extended to actually be useful,
but I'm not sure what the latency is for the modern one.
Linus
Powered by blists - more mailing lists