diff options
author | Mel Gorman <mgorman@suse.de> | 2014-06-04 19:06:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-04 19:53:55 -0400 |
commit | c46a7c817e662a820373bb76b88d0ad67d6abe5d (patch) | |
tree | 41a7d24c818c9cfe71f335f7fdae162896aa3b23 /include/asm-generic | |
parent | 4468dd76f51f8be75d4f04f1d721e379596e7262 (diff) |
x86: define _PAGE_NUMA by reusing software bits on the PMD and PTE levels
_PAGE_NUMA is currently an alias of _PROT_PROTNONE to trap NUMA hinting
faults on x86. Care is taken such that _PAGE_NUMA is used only in
situations where the VMA flags distinguish between NUMA hinting faults
and prot_none faults. This decision was x86-specific and conceptually
it is difficult requiring special casing to distinguish between PROTNONE
and NUMA ptes based on context.
Fundamentally, we only need the _PAGE_NUMA bit to tell the difference
between an entry that is really unmapped and a page that is protected
for NUMA hinting faults as if the PTE is not present then a fault will
be trapped.
Swap PTEs on x86-64 use the bits after _PAGE_GLOBAL for the offset.
This patch shrinks the maximum possible swap size and uses the bit to
uniquely distinguish between NUMA hinting ptes and swap ptes.
Signed-off-by: Mel Gorman <mgorman@suse.de>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Anvin <hpa@zytor.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Steven Noonan <steven@uplinklabs.net>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/pgtable.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index a8015a7a55bb..53b2acc38213 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -233,6 +233,10 @@ static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b) | |||
233 | # define pte_accessible(mm, pte) ((void)(pte), 1) | 233 | # define pte_accessible(mm, pte) ((void)(pte), 1) |
234 | #endif | 234 | #endif |
235 | 235 | ||
236 | #ifndef pte_present_nonuma | ||
237 | #define pte_present_nonuma(pte) pte_present(pte) | ||
238 | #endif | ||
239 | |||
236 | #ifndef flush_tlb_fix_spurious_fault | 240 | #ifndef flush_tlb_fix_spurious_fault |
237 | #define flush_tlb_fix_spurious_fault(vma, address) flush_tlb_page(vma, address) | 241 | #define flush_tlb_fix_spurious_fault(vma, address) flush_tlb_page(vma, address) |
238 | #endif | 242 | #endif |
@@ -670,7 +674,7 @@ static inline int pmd_trans_unstable(pmd_t *pmd) | |||
670 | static inline int pte_numa(pte_t pte) | 674 | static inline int pte_numa(pte_t pte) |
671 | { | 675 | { |
672 | return (pte_flags(pte) & | 676 | return (pte_flags(pte) & |
673 | (_PAGE_NUMA|_PAGE_PRESENT)) == _PAGE_NUMA; | 677 | (_PAGE_NUMA|_PAGE_PROTNONE|_PAGE_PRESENT)) == _PAGE_NUMA; |
674 | } | 678 | } |
675 | #endif | 679 | #endif |
676 | 680 | ||
@@ -678,7 +682,7 @@ static inline int pte_numa(pte_t pte) | |||
678 | static inline int pmd_numa(pmd_t pmd) | 682 | static inline int pmd_numa(pmd_t pmd) |
679 | { | 683 | { |
680 | return (pmd_flags(pmd) & | 684 | return (pmd_flags(pmd) & |
681 | (_PAGE_NUMA|_PAGE_PRESENT)) == _PAGE_NUMA; | 685 | (_PAGE_NUMA|_PAGE_PROTNONE|_PAGE_PRESENT)) == _PAGE_NUMA; |
682 | } | 686 | } |
683 | #endif | 687 | #endif |
684 | 688 | ||