where is __memory_barrier in kernel ?

Jim Cromie jim.cromie at gmail.com
Sat Mar 12 21:26:11 EST 2011


On Thu, Mar 10, 2011 at 8:13 AM, loody <miloody at gmail.com> wrote:

> hi
>
> 2011/3/8 piyush moghe <pmkernel at gmail.com>:
> > Yes what you are saying is also right, since in order to prevent the
> > ordering all the pending memory operations should have completed
> > hence as you mentioned processor stops and make sure all the memory
> > operations are completed.
> I am not sure whether all the memory operations are completed after
> cpu stops running for a while.
> I think there should be a more aggressive and precise instruction  to
> handle this behavior, right?
> appreciate your kind help,
> miloody


a consolidated view of locking primitives is in
linux-2.6.git/tools/perf/perf.h

it defines rmb(), cpu_relax() for many architectures in a single place.

the comment block here:
 http://lxr.free-electrons.com/source/arch/x86/include/asm/system.h#L357

lines 371-421, say that rmb is heavier than memory_barrier() or barrier().
I think the comment speaks to your "aggressive and precise" questions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110312/c8295070/attachment.html 


More information about the Kernelnewbies mailing list