]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm/generic: Only flush the local TLB in ptep_set_access_flags()
authorRik van Riel <riel@redhat.com>
Sat, 27 Oct 2012 16:12:11 +0000 (12:12 -0400)
committerIngo Molnar <mingo@kernel.org>
Sun, 28 Oct 2012 13:46:04 +0000 (14:46 +0100)
commitd24fc0571afbe91eb17162079aa0c7aa9a3608cd
tree396960dd163d04406ea7f985af3bf2908efb574a
parente657e078d3dfa9f96976db7a2b5fd7d7c9f1f1a6
mm/generic: Only flush the local TLB in ptep_set_access_flags()

The function ptep_set_access_flags() is only ever used to upgrade
access permissions to a page - i.e. they make it less restrictive.

That means the only negative side effect of not flushing remote
TLBs in this function is that other CPUs may incur spurious page
faults, if they happen to access the same address, and still have
a PTE with the old permissions cached in their TLB caches.

Having another CPU maybe incur a spurious page fault is faster
than always incurring the cost of a remote TLB flush, so replace
the remote TLB flush with a purely local one.

This should be safe on every architecture that correctly
implements flush_tlb_fix_spurious_fault() to actually invalidate
the local TLB entry that caused a page fault, as well as on
architectures where the hardware invalidates TLB entries that
cause page faults.

In the unlikely event that you are hitting what appears to be
an infinite loop of page faults, and 'git bisect' took you to
this changeset, your architecture needs to implement
flush_tlb_fix_spurious_fault() to actually flush the TLB entry.

Signed-off-by: Rik van Riel <riel@redhat.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Michel Lespinasse <walken@google.com>
[ Changelog massage. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
mm/pgtable-generic.c