From: Rik van Riel Date: Tue, 9 Oct 2012 13:31:59 +0000 (+0200) Subject: mm: Only flush the TLB when clearing an accessible pte X-Git-Tag: next-20121029~34^2^2~24 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6fe64360a759f3cbbff4835da4c226d6cb78c34d;p=karo-tx-linux.git mm: Only flush the TLB when clearing an accessible pte If ptep_clear_flush() is called to clear a page table entry that is accessible anyway by the CPU, eg. a _PAGE_PROTNONE page table entry, there is no need to flush the TLB on remote CPUs. Signed-off-by: Rik van Riel Signed-off-by: Peter Zijlstra Cc: Linus Torvalds Cc: Andrew Morton Link: http://lkml.kernel.org/n/tip-vm3rkzevahelwhejx5uwm8ex@git.kernel.org Signed-off-by: Ingo Molnar --- diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c index d8397da42fe6..0c8323fe6c8f 100644 --- a/mm/pgtable-generic.c +++ b/mm/pgtable-generic.c @@ -88,7 +88,8 @@ pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address, { pte_t pte; pte = ptep_get_and_clear((vma)->vm_mm, address, ptep); - flush_tlb_page(vma, address); + if (pte_accessible(pte)) + flush_tlb_page(vma, address); return pte; } #endif