lkml.org 
[lkml]   [2013]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86 idle: repair large-server 50-watt idle-power regression

* H. Peter Anvin <hpa@zytor.com> wrote:

> On 12/19/2013 10:09 AM, H. Peter Anvin wrote:
> > On 12/19/2013 09:07 AM, Ingo Molnar wrote:
> >>
> >> Likewise, having a barrier before the MONITOR looks sensible as well.
> >> Having it _after_ monitor looks weird and is probably wrong. [It might
> >> have been the effects of someone seeing the spurious wakeup problems
> >> with realizing the true source, or so.]
> >>
> >
> > Does anyone know the history of this barrier after the monitor? I know
> > Len is looking for a minimal patchset that can go into -stable, and it
> > seems prudent to not preturb the code more than necessary, but going
> > forward it would be nice to know...
> >
>
> Hmm... it *looks* like it is intended to be part of the construct:
>
> smp_mb();
> if (!need_resched())
> ...
>
> I found a note in the HLT variant of the function saying:
>
> /*
> * TS_POLLING-cleared state must be visible before we
> * test NEED_RESCHED:
> */

Yes, that makes sense: the need_resched test is a load, and MONITOR is
a load as well. Can the two ever cross, or does the CPU guarantee that
because it's the same address, the loads don't cross?

Thanks,

Ingo


\
 
 \ /
  Last update: 2013-12-22 05:41    [W:0.426 / U:1.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site