aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic/pgtable.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-09 22:26:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-09 22:26:14 -0400
commit0cf744bc7ae8e0072159a901f6e1a159bbc30ffa (patch)
treefc8222a3a5af4f42226070c3f76462cfcf0b4e50 /include/asm-generic/pgtable.h
parentb528392669415dc1e53a047215e5ad6c2de879fc (diff)
parent7f8998c7aef3ac9c5f3f2943e083dfa6302e90d0 (diff)
Merge branch 'akpm' (fixes from Andrew Morton)
Merge patch-bomb from Andrew Morton: - part of OCFS2 (review is laggy again) - procfs - slab - all of MM - zram, zbud - various other random things: arch, filesystems. * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (164 commits) nosave: consolidate __nosave_{begin,end} in <asm/sections.h> include/linux/screen_info.h: remove unused ORIG_* macros kernel/sys.c: compat sysinfo syscall: fix undefined behavior kernel/sys.c: whitespace fixes acct: eliminate compile warning kernel/async.c: switch to pr_foo() include/linux/blkdev.h: use NULL instead of zero include/linux/kernel.h: deduplicate code implementing clamp* macros include/linux/kernel.h: rewrite min3, max3 and clamp using min and max alpha: use Kbuild logic to include <asm-generic/sections.h> frv: remove deprecated IRQF_DISABLED frv: remove unused cpuinfo_frv and friends to fix future build error zbud: avoid accessing last unused freelist zsmalloc: simplify init_zspage free obj linking mm/zsmalloc.c: correct comment for fullness group computation zram: use notify_free to account all free notifications zram: report maximum used memory zram: zram memory size limitation zsmalloc: change return value unit of zs_get_total_size_bytes zsmalloc: move pages_allocated to zs_pool ...
Diffstat (limited to 'include/asm-generic/pgtable.h')
-rw-r--r--include/asm-generic/pgtable.h27
1 files changed, 9 insertions, 18 deletions
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index 977e545a64c3..081ff8826bf6 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -664,11 +664,12 @@ static inline int pmd_trans_unstable(pmd_t *pmd)
664} 664}
665 665
666#ifdef CONFIG_NUMA_BALANCING 666#ifdef CONFIG_NUMA_BALANCING
667#ifdef CONFIG_ARCH_USES_NUMA_PROT_NONE
668/* 667/*
669 * _PAGE_NUMA works identical to _PAGE_PROTNONE (it's actually the 668 * _PAGE_NUMA distinguishes between an unmapped page table entry, an entry that
670 * same bit too). It's set only when _PAGE_PRESET is not set and it's 669 * is protected for PROT_NONE and a NUMA hinting fault entry. If the
671 * never set if _PAGE_PRESENT is set. 670 * architecture defines __PAGE_PROTNONE then it should take that into account
671 * but those that do not can rely on the fact that the NUMA hinting scanner
672 * skips inaccessible VMAs.
672 * 673 *
673 * pte/pmd_present() returns true if pte/pmd_numa returns true. Page 674 * pte/pmd_present() returns true if pte/pmd_numa returns true. Page
674 * fault triggers on those regions if pte/pmd_numa returns true 675 * fault triggers on those regions if pte/pmd_numa returns true
@@ -677,16 +678,14 @@ static inline int pmd_trans_unstable(pmd_t *pmd)
677#ifndef pte_numa 678#ifndef pte_numa
678static inline int pte_numa(pte_t pte) 679static inline int pte_numa(pte_t pte)
679{ 680{
680 return (pte_flags(pte) & 681 return ptenuma_flags(pte) == _PAGE_NUMA;
681 (_PAGE_NUMA|_PAGE_PROTNONE|_PAGE_PRESENT)) == _PAGE_NUMA;
682} 682}
683#endif 683#endif
684 684
685#ifndef pmd_numa 685#ifndef pmd_numa
686static inline int pmd_numa(pmd_t pmd) 686static inline int pmd_numa(pmd_t pmd)
687{ 687{
688 return (pmd_flags(pmd) & 688 return pmdnuma_flags(pmd) == _PAGE_NUMA;
689 (_PAGE_NUMA|_PAGE_PROTNONE|_PAGE_PRESENT)) == _PAGE_NUMA;
690} 689}
691#endif 690#endif
692 691
@@ -726,6 +725,8 @@ static inline pte_t pte_mknuma(pte_t pte)
726{ 725{
727 pteval_t val = pte_val(pte); 726 pteval_t val = pte_val(pte);
728 727
728 VM_BUG_ON(!(val & _PAGE_PRESENT));
729
729 val &= ~_PAGE_PRESENT; 730 val &= ~_PAGE_PRESENT;
730 val |= _PAGE_NUMA; 731 val |= _PAGE_NUMA;
731 732
@@ -769,16 +770,6 @@ static inline void pmdp_set_numa(struct mm_struct *mm, unsigned long addr,
769} 770}
770#endif 771#endif
771#else 772#else
772extern int pte_numa(pte_t pte);
773extern int pmd_numa(pmd_t pmd);
774extern pte_t pte_mknonnuma(pte_t pte);
775extern pmd_t pmd_mknonnuma(pmd_t pmd);
776extern pte_t pte_mknuma(pte_t pte);
777extern pmd_t pmd_mknuma(pmd_t pmd);
778extern void ptep_set_numa(struct mm_struct *mm, unsigned long addr, pte_t *ptep);
779extern void pmdp_set_numa(struct mm_struct *mm, unsigned long addr, pmd_t *pmdp);
780#endif /* CONFIG_ARCH_USES_NUMA_PROT_NONE */
781#else
782static inline int pmd_numa(pmd_t pmd) 773static inline int pmd_numa(pmd_t pmd)
783{ 774{
784 return 0; 775 return 0;