where is __memory_barrier in kernel ?

piyush moghe pmkernel at gmail.com
Tue Mar 8 01:20:07 EST 2011


AFAIK memory barriers are the architecture specific instructions which
restricts the instruction execution in order as received, since otherwise
CPU might change the order of execution of instructions for effective use of
pipelines or instruction execution optimizations.

Although many times it is required that the instructions to be executed in
particular order only in order to prevent the consistency of data and hence
memory barriers are required.

Regards,
Piyush


2011/3/6 Михаил Кринкин <krinkin.m.u at gmail.com>

> You can see linux/Documentation/memory_barriers.txt about barriers in common
>
>
> i think, that specific definition of __memory_barrier depend on architecture. What file did you found this definition in?
>
>
>
> 2011/3/6 loody <miloody at gmail.com>
>
> hi all:
>> I grep kernel source and found cpu_relax is defined as
>> __memory_barrier(), which seems not defined in kernel source.
>> At beginning I think it may be the gcc build-in functions, but I
>> cannot find in the gcc document.
>> Where and what is that used for?
>>
>> --
>> Regards,
>> miloody
>>
>> _______________________________________________
>> Kernelnewbies mailing list
>> Kernelnewbies at kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110308/317c8b05/attachment.html 


More information about the Kernelnewbies mailing list