Re: page table lock patch V15 [0/7]: overview

From: Andi Kleen <>
Date: 2005-01-13 14:18:07
> There is still an issue as Hugh rightly observed. One cannot rely on a
> read of a pte/pud/pmd being atomic if the pte is > word size. This occurs
> for all higher levels in handle_mm_fault. Thus we would need to either
> acuire the page_table_lock for some architectures or provide primitives
> get_pgd, get_pud etc that take the page_table_lock on PAE mode. ARGH.

Alternatively you can use a lazy load, checking for changes. 

pte_t read_pte(volatile pte_t *pte) 
	pte_t n;
	do { 
		n.pte_low = pte->pte_low;
		n.pte_high = pte->pte_high;
	} while (n.pte_low != pte->pte_low); 
	return pte; 	

No atomic operations, I bet it's actually faster than the cmpxchg8.
There is a small risk for livelock, but not much worse than with an
ordinary spinlock.

Not that I get it what you want it for exactly - the content
of the pte could change any time when you don't hold page_table_lock, right?

To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to
More majordomo info at
Received on Wed Jan 12 22:18:23 2005

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:34 EST