Re: [PATCH] ppc64: Fix possible race with set_pte on a present PTE

Benjamin Herrenschmidt
2004-05-25T22:19:24Z

On Wed, 2004-05-26 at 08:09, Linus Torvalds wrote:

> But if we don't update the hash tables, how will the TLB entry _ever_ say
> that the page is writable? So we won't take just _one_ extra fault on the
> next write, we'll _keep_ taking them, since the hash tables will continue
> to claim that the page is read-only, even if the linux sw page tables say
> it is writable.
>
> So I think the code needs to invalidate the hash after having updated the
> pte. No?

No, we'll take a hash fault, not a page fault. The hash fault is an asm
fast path, which in this case, will update the HPTE RW permission when
the PTE has PAGE_RW (and will set PAGE_DIRTY again, but that's fine).

Ben.