Re: [patch]x86: avoid unnecessary tlb flush

From: Suresh Siddha
Date: Fri Aug 13 2010 - 19:01:11 EST


On Fri, 2010-08-13 at 14:08 -0700, H. Peter Anvin wrote:
> On 08/13/2010 12:29 PM, Hugh Dickins wrote:
> >
> > Just added Andrea to the Cc list: he did that TLB flush in 1a44e149,
> > I'd feel more comfortable noop-ing it on x86 if you've convinced him.
> >
> > Hugh
>
> Andrea is probably on his way back from LinuxCon, but looking at the
> original patch it might be something that non-x86 architectures need,
> but which can be optimized specifically on x86, since x86 has explicit
> "no flush needed when going to more permissive" semantics.

Yes. I don't see a problem with the proposed patch. This is the case of
parallel thread execution getting spurious write protection faults for
the same page for which the pte entry is already up to date and the
fault has already flushed the existing spurious TLB entry in the case of
x86.

I prefer a better name for the new flush_tlb_nonprotect_page() to
reflect the above. something like tlb_fix_spurious_fault() or something?

Also for other architectures, in this case, do we really need a global
tlb flush or just the local tlb flush?

Acked-by: Suresh Siddha <suresh.b.siddha@xxxxxxxxx>

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