Skip to content

Commit 8d1acce

Browse files
Rik van RielMel Gorman
authored andcommitted
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 <riel@redhat.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/n/tip-vm3rkzevahelwhejx5uwm8ex@git.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 2c3cf55 commit 8d1acce

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎mm/pgtable-generic.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address,
8888
{
8989
pte_t pte;
9090
pte = ptep_get_and_clear((vma)->vm_mm, address, ptep);
91-
flush_tlb_page(vma, address);
91+
if (pte_accessible(pte))
92+
flush_tlb_page(vma, address);
9293
return pte;
9394
}
9495
#endif

0 commit comments

Comments
 (0)