lkml.org 
[lkml]   [2008]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [ANNOUNCE] mdb: Merkey's Linux Kernel Debugger 2.6.27-rc4 released
Peter Zijlstra wrote:
> Not sure - I think all barrier clobber the full register and memory set.
> So if you access a variable after a barrier it will have to issue a
> load.
>

IIRC a barrier only clobbers memory. gcc must reload a variable from
memory unless it can prove the variable's address has not escaped anywhere.

So:

void f()
{
int v;

v = g();
barrier();
do_domething_with(v);
}

Need not reload v from memory (indeed, v can be in a register for its
entire lifetime), but

void f()
{
int v;

v = g();
h(&v);
barrier();
do_domething_with(v);
}

Will force v into memory, and reload it after the barrier.

--
error compiling committee.c: too many arguments to function



\
 
 \ /
  Last update: 2008-08-21 18:25    [W:0.171 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site