lkml.org 
[lkml]   [2008]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] tracing/function-return-tracer: Make the function return tracer lockless
On Thu, Nov 13, 2008 at 12:32:23PM -0500, Steven Rostedt wrote:
>
> On Thu, 13 Nov 2008, Andi Kleen wrote:
>
> > > So the answer to this is:
> > >
> > > i = index++;
> > > barrier();
> > > write to index i (not index);
> >
> > That was my first thought when I wrote the original email,
> > but the disadvantage is that barrier() is a big hammer
> > that flushes everything and can make the code much worse.
> > That is why I suggested local_add_return() instead.
>
> barrier() is a compiler barrier, does nothing with the caches, and is
> quite cheap. We only need a compiler barrier because we are only

I did not refer to CPU caches, but the compiler's register allocation
[ok if you want the registers are the "level 0 cache"]. A memory barrier
all messes it up. That is why it is better to only clobber specific
memory regions, which is what local_* does.

-Andi

--
ak@linux.intel.com


\
 
 \ /
  Last update: 2008-11-13 19:23    [W:0.078 / U:0.976 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site