Re: zap_page_range(): TLB flush race

From: Kanoj Sarcar (kanoj@google.engr.sgi.com)
Date: Sat Apr 08 2000 - 18:54:32 EST


>
> > > Yes, establish_pte() is broken. We should reverse the calls:
> > >
> > > set_pte(); /* update the kernel page tables */
> > > update_mmu(); /* update architecture specific page tables. */
> > > flush_tlb(); /* and flush the hardware tlb */
> > >
> >
> > People are aware of this too, it was introduced during the 390 merge.
> > I tried talking to the IBM guy about this, I didn't see a response from
> > him ...
>
> Strange since I did and it included you

Yes, I did get the first mail from the IBM guy (was he from Denmark, seem
to have seen ibm.de in his email?) explaining why the 390 wanted this
ordering ... In response, I pointed out that the 390 was either prone
to other races then, or was doing something in its low level handlers,
and could he please confirm what is the case?

Let me remember: he mentioned the old pte must be around for the ipte(?)
instruction to flush the tlb. If the new pte is dropped in before, the
flush fails, the stale tlb entry stays, problems happen. So I pointed out
other places which do set_pte, then flush_tlb. I also wanted to know
whether the flush_tlb somehow makes sure that other threads/cpus can not
pull in the old translation till the set_pte completes (something like
what freeze_pte_* does in my patch). I did not receive a response to this.

>
> > I think what we now need is a critical mass, something that will make us
> > go "okay, lets just fix these races once and for all".
>
> Basically establish_pte() has to be architecture specific, as some processors
> need different orders either to avoid races or to handle cpu specific
> limitations.

Even if you did that, wouldn't it just mean that the 390 would still be
prone to races, but other platforms are not? Of course, that's much
better than having all platforms be prone to the race!

And we should also handle the generic races with clones and ptes, an
example of which Manfred just demonstrated.

Kanoj
>
> Alan
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux.eu.org/Linux-MM/
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:12 EST