[RFC PATCH 2/2] ARMv7: Invalidate the TLB before freeing page tables
Russell King - ARM Linux
linux at arm.linux.org.uk
Tue Feb 15 06:32:42 EST 2011
On Tue, Feb 15, 2011 at 11:02:28AM +0000, Catalin Marinas wrote:
> On Tue, 2011-02-15 at 10:31 +0000, Russell King - ARM Linux wrote:
> > We already have support for doing this, and Peter Zijlstra posted patches
> > to convert ARM to use a generic implementation of the TLB shootdown code.
> >
> > http://marc.info/?l=linux-kernel&m=129604765010347&w=2
> >
> > Does this patch solve your problem?
>
> I don't think it does. Peter's patch moves the ARM TLB support to the
> generic one which is a good clean-up, however it doesn't look like
> anything is invalidating the TLB entry between pmd_clear() and
> pte_free(), only after.
Can we please stop thinking "ooh, lets use generic code, that's good" ?
It's a rediculous attitude. The reason we have our own version is because
the generic version is too heavy for our UP implementations and it doesn't
do what we need to do there.
I believe we should stick with our own version for UP, and switch over to
the generic version for SMP.
> This is too late because we may speculatively
> get a global TLB entry (which isn't invalidated by the ASID TLB
> operations). So with Peter's patch we still have to implement
> __pte_free_tlb().
The point of TLB shootdown is that we unmap the entries from the page
tables, then issue the TLB flushes, and then free the pages and page
tables after that. All that Peter's patch tries to do is to get ARM to
use the generic stuff.
More information about the linux-arm-kernel
mailing list