x86/mm: Introduce pte_accessible()
authorRik van Riel <riel@redhat.com>
Tue, 9 Oct 2012 13:31:12 +0000 (15:31 +0200)
committerMel Gorman <mgorman@suse.de>
Tue, 11 Dec 2012 14:28:34 +0000 (14:28 +0000)
commit2c3cf556b2f7ab5823195766eddec6f1a43134f5
treeed36a604ac7e629e4eb7c36eda1560ba5b19df59
parentcef23d9db6b76732d9b0933cb162358a6a1f43d7
x86/mm: Introduce pte_accessible()

We need pte_present to return true for _PAGE_PROTNONE pages, to indicate that
the pte is associated with a page.

However, for TLB flushing purposes, we would like to know whether the pte
points to an actually accessible page.  This allows us to skip remote TLB
flushes for pages that are not actually accessible.

Fill in this method for x86 and provide a safe (but slower) method
on other architectures.

Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Fixed-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-66p11te4uj23gevgh4j987ip@git.kernel.org
[ Added Linus's review fixes. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/pgtable.h
include/asm-generic/pgtable.h