Skip to content

Commit

Permalink
mm: Only flush the TLB when clearing an accessible pte
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rik van Riel authored and Mel Gorman committed Dec 11, 2012
1 parent 2c3cf55 commit 8d1acce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mm/pgtable-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8d1acce

Please sign in to comment.