[PATCH -V10 10/15] powerpc: Prevent gcc to re-read the pagetables

Benjamin Herrenschmidt benh at kernel.crashing.org
Thu Jun 6 08:39:38 EST 2013


On Wed, 2013-06-05 at 16:41 +0100, David Laight wrote:
> >  	ptep = pte_offset_kernel(&pmd, addr);
> >  	do {
> > -		pte_t pte = *ptep;
> > +		pte_t pte = ACCESS_ONCE(*ptep);
> 
> Why not just define ptep as a 'pointer to volatile'?

ACCESS_ONCE is the proper way to do it in Linux. pointer to volatile
can have ... interesting semantics.

Cheers,
Ben.




More information about the Linuxppc-dev mailing list