lkml.org 
[lkml]   [2008]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [5/20] x86: Introduce nsec_barrier()

* Andi Kleen <ak@suse.de> wrote:

> nsec_barrier() is a new barrier primitive that stops RDTSC speculation
> to avoid races with timer interrupts on other CPUs.
>
> Add it to all architectures. Except for x86 it is a nop right now. I
> only tested x86, but it's a very simple change.
>
> On x86 it expands either to LFENCE (for Intel CPUs) or MFENCE (for AMD
> CPUs) which stops RDTSC on all currently known microarchitectures that
> implement SSE. On CPUs without SSE there is generally no RDTSC
> speculation.

i've picked up your rdtsc patches into x86.git but have simplified it:
there's no nsec_barrier() anymore - rdtsc() is always synchronous.
MFENCE/LFENCE is fast enough. Open-coding such barriers almost always
leads to needless trouble. Please check the next x86.git tree.

Ingo


\
 
 \ /
  Last update: 2008-01-03 11:51    [W:0.814 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site