lkml.org 
[lkml]   [2013]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip:x86/idle] x86, idle: Use static_cpu_has() for CLFLUSH workaround, add barriers

* Peter Zijlstra <peterz@infradead.org> wrote:

> On Thu, Dec 19, 2013 at 09:40:51PM +0100, Ingo Molnar wrote:
> > > + if (static_cpu_has(X86_FEATURE_CLFLUSH_MONITOR)) {
> > > + mb();
> > > clflush((void *)&current_thread_info()->flags);
> > > + mb();
> > > + }
>
> > if (!current_set_polling_and_test()) {
> > if (static_cpu_has(X86_FEATURE_CLFLUSH_MONITOR)) {
> > - mb();
> > + /*
> > + * There's no need for an extra barrier here: current_set_polling_and_test()
> > + * already has an smp_mb() after ->flags gets modified, see sched.h.
> > + */
> > clflush((void *)&current_thread_info()->flags);
> > mb();
> > }
>
> So almost, except that smp_mb() will disappear on an UP kernel whereas
> this errata might just always need the MFENCE.

Yeah. Sigh, so I noticed that and even thought through the UP case and
concluded: on UP the race cannot happen - which is bogus. Yesterday
was so much fail, maybe today's a better day ;-)

Thanks,

ngo


\
 
 \ /
  Last update: 2013-12-20 10:01    [W:0.051 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site