aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include
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 /arch/powerpc/include
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 'arch/powerpc/include')
-rw-r--r--arch/powerpc/include/asm/pgtable.h57
-rw-r--r--arch/powerpc/include/asm/pte-common.h5
2 files changed, 17 insertions, 45 deletions
diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
index d98c1ecc3266..f60d4ea8b50c 100644
--- a/arch/powerpc/include/asm/pgtable.h
+++ b/arch/powerpc/include/asm/pgtable.h
@@ -38,10 +38,9 @@ static inline int pte_none(pte_t pte) { return (pte_val(pte) & ~_PTE_NONE_MASK)
38static inline pgprot_t pte_pgprot(pte_t pte) { return __pgprot(pte_val(pte) & PAGE_PROT_BITS); } 38static inline pgprot_t pte_pgprot(pte_t pte) { return __pgprot(pte_val(pte) & PAGE_PROT_BITS); }
39 39
40#ifdef CONFIG_NUMA_BALANCING 40#ifdef CONFIG_NUMA_BALANCING
41
42static inline int pte_present(pte_t pte) 41static inline int pte_present(pte_t pte)
43{ 42{
44 return pte_val(pte) & (_PAGE_PRESENT | _PAGE_NUMA); 43 return pte_val(pte) & _PAGE_NUMA_MASK;
45} 44}
46 45
47#define pte_present_nonuma pte_present_nonuma 46#define pte_present_nonuma pte_present_nonuma
@@ -50,37 +49,6 @@ static inline int pte_present_nonuma(pte_t pte)
50 return pte_val(pte) & (_PAGE_PRESENT); 49 return pte_val(pte) & (_PAGE_PRESENT);
51} 50}
52 51
53#define pte_numa pte_numa
54static inline int pte_numa(pte_t pte)
55{
56 return (pte_val(pte) &
57 (_PAGE_NUMA|_PAGE_PRESENT)) == _PAGE_NUMA;
58}
59
60#define pte_mknonnuma pte_mknonnuma
61static inline pte_t pte_mknonnuma(pte_t pte)
62{
63 pte_val(pte) &= ~_PAGE_NUMA;
64 pte_val(pte) |= _PAGE_PRESENT | _PAGE_ACCESSED;
65 return pte;
66}
67
68#define pte_mknuma pte_mknuma
69static inline pte_t pte_mknuma(pte_t pte)
70{
71 /*
72 * We should not set _PAGE_NUMA on non present ptes. Also clear the
73 * present bit so that hash_page will return 1 and we collect this
74 * as numa fault.
75 */
76 if (pte_present(pte)) {
77 pte_val(pte) |= _PAGE_NUMA;
78 pte_val(pte) &= ~_PAGE_PRESENT;
79 } else
80 VM_BUG_ON(1);
81 return pte;
82}
83
84#define ptep_set_numa ptep_set_numa 52#define ptep_set_numa ptep_set_numa
85static inline void ptep_set_numa(struct mm_struct *mm, unsigned long addr, 53static inline void ptep_set_numa(struct mm_struct *mm, unsigned long addr,
86 pte_t *ptep) 54 pte_t *ptep)
@@ -92,12 +60,6 @@ static inline void ptep_set_numa(struct mm_struct *mm, unsigned long addr,
92 return; 60 return;
93} 61}
94 62
95#define pmd_numa pmd_numa
96static inline int pmd_numa(pmd_t pmd)
97{
98 return pte_numa(pmd_pte(pmd));
99}
100
101#define pmdp_set_numa pmdp_set_numa 63#define pmdp_set_numa pmdp_set_numa
102static inline void pmdp_set_numa(struct mm_struct *mm, unsigned long addr, 64static inline void pmdp_set_numa(struct mm_struct *mm, unsigned long addr,
103 pmd_t *pmdp) 65 pmd_t *pmdp)
@@ -109,16 +71,21 @@ static inline void pmdp_set_numa(struct mm_struct *mm, unsigned long addr,
109 return; 71 return;
110} 72}
111 73
112#define pmd_mknonnuma pmd_mknonnuma 74/*
113static inline pmd_t pmd_mknonnuma(pmd_t pmd) 75 * Generic NUMA pte helpers expect pteval_t and pmdval_t types to exist
76 * which was inherited from x86. For the purposes of powerpc pte_basic_t and
77 * pmd_t are equivalent
78 */
79#define pteval_t pte_basic_t
80#define pmdval_t pmd_t
81static inline pteval_t ptenuma_flags(pte_t pte)
114{ 82{
115 return pte_pmd(pte_mknonnuma(pmd_pte(pmd))); 83 return pte_val(pte) & _PAGE_NUMA_MASK;
116} 84}
117 85
118#define pmd_mknuma pmd_mknuma 86static inline pmdval_t pmdnuma_flags(pmd_t pmd)
119static inline pmd_t pmd_mknuma(pmd_t pmd)
120{ 87{
121 return pte_pmd(pte_mknuma(pmd_pte(pmd))); 88 return pmd_val(pmd) & _PAGE_NUMA_MASK;
122} 89}
123 90
124# else 91# else
diff --git a/arch/powerpc/include/asm/pte-common.h b/arch/powerpc/include/asm/pte-common.h
index 8d1569c29042..e040c3595129 100644
--- a/arch/powerpc/include/asm/pte-common.h
+++ b/arch/powerpc/include/asm/pte-common.h
@@ -98,6 +98,11 @@ extern unsigned long bad_call_to_PMD_PAGE_SIZE(void);
98 _PAGE_USER | _PAGE_ACCESSED | \ 98 _PAGE_USER | _PAGE_ACCESSED | \
99 _PAGE_RW | _PAGE_HWWRITE | _PAGE_DIRTY | _PAGE_EXEC) 99 _PAGE_RW | _PAGE_HWWRITE | _PAGE_DIRTY | _PAGE_EXEC)
100 100
101#ifdef CONFIG_NUMA_BALANCING
102/* Mask of bits that distinguish present and numa ptes */
103#define _PAGE_NUMA_MASK (_PAGE_NUMA|_PAGE_PRESENT)
104#endif
105
101/* 106/*
102 * We define 2 sets of base prot bits, one for basic pages (ie, 107 * We define 2 sets of base prot bits, one for basic pages (ie,
103 * cacheable kernel and user pages) and one for non cacheable 108 * cacheable kernel and user pages) and one for non cacheable