Skip to contentSkip to conversation

mm: Only flush the TLB when clearing an accessible pte

tip:sched/numa tip-bot for Rik van Riel 1 participant 1 message Oct 12, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Commit-ID:  154e911b453560aa1e6e11d47e5f95289817b932
Gitweb:     http://git.kernel.org/tip/154e911b453560aa1e6e11d47e5f95289817b932
Author:     Rik van Riel <[email protected]>
AuthorDate: Tue, 9 Oct 2012 15:31:59 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Fri, 12 Oct 2012 12:07:16 +0200

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.

---
 mm/pgtable-generic.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
mm/pgtable-generic.c +2 -1
index 74c0dda..0996d34 100644
@@ -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