path: root/mm/pgtable-generic.c
diff options
authorRik van Riel <>2012-10-09 15:31:59 +0200
committerMel Gorman <>2012-12-11 14:28:34 +0000
commit8d1acce4537c4e2f5889ed9ba9b8eddb80d99820 (patch)
tree8032b026c25b3394613abde6d0f22529a1ef4e2a /mm/pgtable-generic.c
parent2c3cf556b2f7ab5823195766eddec6f1a43134f5 (diff)
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: Signed-off-by: Ingo Molnar <>
Diffstat (limited to 'mm/pgtable-generic.c')
1 files changed, 2 insertions, 1 deletions
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;