diff options
43 files changed, 151 insertions, 151 deletions
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index e9dfbab46cb6..eefae1de334c 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -150,7 +150,7 @@ int __cpuinit __cpu_up(unsigned int cpu) | |||
150 | secondary_data.pgdir = 0; | 150 | secondary_data.pgdir = 0; |
151 | 151 | ||
152 | *pmd_offset(pgd, PHYS_OFFSET) = __pmd(0); | 152 | *pmd_offset(pgd, PHYS_OFFSET) = __pmd(0); |
153 | pgd_free(pgd); | 153 | pgd_free(&init_mm, pgd); |
154 | 154 | ||
155 | if (ret) { | 155 | if (ret) { |
156 | printk(KERN_CRIT "CPU%u: processor failed to boot\n", cpu); | 156 | printk(KERN_CRIT "CPU%u: processor failed to boot\n", cpu); |
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c index 75952779ce19..303a7ff6bfd2 100644 --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c | |||
@@ -162,7 +162,7 @@ static void unmap_area_sections(unsigned long virt, unsigned long size) | |||
162 | * Free the page table, if there was one. | 162 | * Free the page table, if there was one. |
163 | */ | 163 | */ |
164 | if ((pmd_val(pmd) & PMD_TYPE_MASK) == PMD_TYPE_TABLE) | 164 | if ((pmd_val(pmd) & PMD_TYPE_MASK) == PMD_TYPE_TABLE) |
165 | pte_free_kernel(pmd_page_vaddr(pmd)); | 165 | pte_free_kernel(&init_mm, pmd_page_vaddr(pmd)); |
166 | } | 166 | } |
167 | 167 | ||
168 | addr += PGDIR_SIZE; | 168 | addr += PGDIR_SIZE; |
diff --git a/arch/arm/mm/pgd.c b/arch/arm/mm/pgd.c index 50b9aed6000d..500c9610ab30 100644 --- a/arch/arm/mm/pgd.c +++ b/arch/arm/mm/pgd.c | |||
@@ -65,14 +65,14 @@ pgd_t *get_pgd_slow(struct mm_struct *mm) | |||
65 | return new_pgd; | 65 | return new_pgd; |
66 | 66 | ||
67 | no_pte: | 67 | no_pte: |
68 | pmd_free(new_pmd); | 68 | pmd_free(mm, new_pmd); |
69 | no_pmd: | 69 | no_pmd: |
70 | free_pages((unsigned long)new_pgd, 2); | 70 | free_pages((unsigned long)new_pgd, 2); |
71 | no_pgd: | 71 | no_pgd: |
72 | return NULL; | 72 | return NULL; |
73 | } | 73 | } |
74 | 74 | ||
75 | void free_pgd_slow(pgd_t *pgd) | 75 | void free_pgd_slow(struct mm_struct *mm, pgd_t *pgd) |
76 | { | 76 | { |
77 | pmd_t *pmd; | 77 | pmd_t *pmd; |
78 | struct page *pte; | 78 | struct page *pte; |
@@ -94,8 +94,8 @@ void free_pgd_slow(pgd_t *pgd) | |||
94 | pmd_clear(pmd); | 94 | pmd_clear(pmd); |
95 | dec_zone_page_state(virt_to_page((unsigned long *)pgd), NR_PAGETABLE); | 95 | dec_zone_page_state(virt_to_page((unsigned long *)pgd), NR_PAGETABLE); |
96 | pte_lock_deinit(pte); | 96 | pte_lock_deinit(pte); |
97 | pte_free(pte); | 97 | pte_free(mm, pte); |
98 | pmd_free(pmd); | 98 | pmd_free(mm, pmd); |
99 | free: | 99 | free: |
100 | free_pages((unsigned long) pgd, 2); | 100 | free_pages((unsigned long) pgd, 2); |
101 | } | 101 | } |
diff --git a/arch/frv/mm/pgalloc.c b/arch/frv/mm/pgalloc.c index 7787c3cc52c6..1a2e5c8d03a9 100644 --- a/arch/frv/mm/pgalloc.c +++ b/arch/frv/mm/pgalloc.c | |||
@@ -140,7 +140,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm) | |||
140 | return pgd; | 140 | return pgd; |
141 | } | 141 | } |
142 | 142 | ||
143 | void pgd_free(pgd_t *pgd) | 143 | void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
144 | { | 144 | { |
145 | /* in the non-PAE case, clear_page_tables() clears user pgd entries */ | 145 | /* in the non-PAE case, clear_page_tables() clears user pgd entries */ |
146 | quicklist_free(0, pgd_dtor, pgd); | 146 | quicklist_free(0, pgd_dtor, pgd); |
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c index 64488723162a..f80f90c4d58b 100644 --- a/arch/powerpc/mm/pgtable_32.c +++ b/arch/powerpc/mm/pgtable_32.c | |||
@@ -86,7 +86,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm) | |||
86 | return ret; | 86 | return ret; |
87 | } | 87 | } |
88 | 88 | ||
89 | void pgd_free(pgd_t *pgd) | 89 | void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
90 | { | 90 | { |
91 | free_pages((unsigned long)pgd, PGDIR_ORDER); | 91 | free_pages((unsigned long)pgd, PGDIR_ORDER); |
92 | } | 92 | } |
@@ -123,7 +123,7 @@ struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) | |||
123 | return ptepage; | 123 | return ptepage; |
124 | } | 124 | } |
125 | 125 | ||
126 | void pte_free_kernel(pte_t *pte) | 126 | void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
127 | { | 127 | { |
128 | #ifdef CONFIG_SMP | 128 | #ifdef CONFIG_SMP |
129 | hash_page_sync(); | 129 | hash_page_sync(); |
@@ -131,7 +131,7 @@ void pte_free_kernel(pte_t *pte) | |||
131 | free_page((unsigned long)pte); | 131 | free_page((unsigned long)pte); |
132 | } | 132 | } |
133 | 133 | ||
134 | void pte_free(struct page *ptepage) | 134 | void pte_free(struct mm_struct *mm, struct page *ptepage) |
135 | { | 135 | { |
136 | #ifdef CONFIG_SMP | 136 | #ifdef CONFIG_SMP |
137 | hash_page_sync(); | 137 | hash_page_sync(); |
diff --git a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c index fadacfd18806..409fcaa4994a 100644 --- a/arch/ppc/mm/pgtable.c +++ b/arch/ppc/mm/pgtable.c | |||
@@ -74,7 +74,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm) | |||
74 | return ret; | 74 | return ret; |
75 | } | 75 | } |
76 | 76 | ||
77 | void pgd_free(pgd_t *pgd) | 77 | void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
78 | { | 78 | { |
79 | free_pages((unsigned long)pgd, PGDIR_ORDER); | 79 | free_pages((unsigned long)pgd, PGDIR_ORDER); |
80 | } | 80 | } |
@@ -111,7 +111,7 @@ struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) | |||
111 | return ptepage; | 111 | return ptepage; |
112 | } | 112 | } |
113 | 113 | ||
114 | void pte_free_kernel(pte_t *pte) | 114 | void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
115 | { | 115 | { |
116 | #ifdef CONFIG_SMP | 116 | #ifdef CONFIG_SMP |
117 | hash_page_sync(); | 117 | hash_page_sync(); |
@@ -119,7 +119,7 @@ void pte_free_kernel(pte_t *pte) | |||
119 | free_page((unsigned long)pte); | 119 | free_page((unsigned long)pte); |
120 | } | 120 | } |
121 | 121 | ||
122 | void pte_free(struct page *ptepage) | 122 | void pte_free(struct mm_struct *mm, struct page *ptepage) |
123 | { | 123 | { |
124 | #ifdef CONFIG_SMP | 124 | #ifdef CONFIG_SMP |
125 | hash_page_sync(); | 125 | hash_page_sync(); |
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index 59822dee438a..e3e72418f241 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c | |||
@@ -348,7 +348,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm) | |||
348 | return pgd; | 348 | return pgd; |
349 | } | 349 | } |
350 | 350 | ||
351 | void pgd_free(pgd_t *pgd) | 351 | void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
352 | { | 352 | { |
353 | free_page((unsigned long) pgd); | 353 | free_page((unsigned long) pgd); |
354 | } | 354 | } |
diff --git a/arch/um/kernel/skas/mmu.c b/arch/um/kernel/skas/mmu.c index f859ec306cd5..b56fe8b67a81 100644 --- a/arch/um/kernel/skas/mmu.c +++ b/arch/um/kernel/skas/mmu.c | |||
@@ -58,9 +58,9 @@ static int init_stub_pte(struct mm_struct *mm, unsigned long proc, | |||
58 | return 0; | 58 | return 0; |
59 | 59 | ||
60 | out_pmd: | 60 | out_pmd: |
61 | pud_free(pud); | 61 | pud_free(mm, pud); |
62 | out_pte: | 62 | out_pte: |
63 | pmd_free(pmd); | 63 | pmd_free(mm, pmd); |
64 | out: | 64 | out: |
65 | return -ENOMEM; | 65 | return -ENOMEM; |
66 | } | 66 | } |
@@ -144,10 +144,10 @@ void destroy_context(struct mm_struct *mm) | |||
144 | if (!proc_mm || !ptrace_faultinfo) { | 144 | if (!proc_mm || !ptrace_faultinfo) { |
145 | free_page(mmu->id.stack); | 145 | free_page(mmu->id.stack); |
146 | pte_lock_deinit(virt_to_page(mmu->last_page_table)); | 146 | pte_lock_deinit(virt_to_page(mmu->last_page_table)); |
147 | pte_free_kernel((pte_t *) mmu->last_page_table); | 147 | pte_free_kernel(mm, (pte_t *) mmu->last_page_table); |
148 | dec_zone_page_state(virt_to_page(mmu->last_page_table), NR_PAGETABLE); | 148 | dec_zone_page_state(virt_to_page(mmu->last_page_table), NR_PAGETABLE); |
149 | #ifdef CONFIG_3_LEVEL_PGTABLES | 149 | #ifdef CONFIG_3_LEVEL_PGTABLES |
150 | pmd_free((pmd_t *) mmu->last_pmd); | 150 | pmd_free(mm, (pmd_t *) mmu->last_pmd); |
151 | #endif | 151 | #endif |
152 | } | 152 | } |
153 | 153 | ||
diff --git a/arch/x86/mm/pgtable_32.c b/arch/x86/mm/pgtable_32.c index c7db504be1ea..6c1914622a88 100644 --- a/arch/x86/mm/pgtable_32.c +++ b/arch/x86/mm/pgtable_32.c | |||
@@ -272,7 +272,7 @@ static void pgd_dtor(void *pgd) | |||
272 | * preallocate which never got a corresponding vma will need to be | 272 | * preallocate which never got a corresponding vma will need to be |
273 | * freed manually. | 273 | * freed manually. |
274 | */ | 274 | */ |
275 | static void pgd_mop_up_pmds(pgd_t *pgdp) | 275 | static void pgd_mop_up_pmds(struct mm_struct *mm, pgd_t *pgdp) |
276 | { | 276 | { |
277 | int i; | 277 | int i; |
278 | 278 | ||
@@ -285,7 +285,7 @@ static void pgd_mop_up_pmds(pgd_t *pgdp) | |||
285 | pgdp[i] = native_make_pgd(0); | 285 | pgdp[i] = native_make_pgd(0); |
286 | 286 | ||
287 | paravirt_release_pd(pgd_val(pgd) >> PAGE_SHIFT); | 287 | paravirt_release_pd(pgd_val(pgd) >> PAGE_SHIFT); |
288 | pmd_free(pmd); | 288 | pmd_free(mm, pmd); |
289 | } | 289 | } |
290 | } | 290 | } |
291 | } | 291 | } |
@@ -313,7 +313,7 @@ static int pgd_prepopulate_pmd(struct mm_struct *mm, pgd_t *pgd) | |||
313 | pmd_t *pmd = pmd_alloc_one(mm, addr); | 313 | pmd_t *pmd = pmd_alloc_one(mm, addr); |
314 | 314 | ||
315 | if (!pmd) { | 315 | if (!pmd) { |
316 | pgd_mop_up_pmds(pgd); | 316 | pgd_mop_up_pmds(mm, pgd); |
317 | return 0; | 317 | return 0; |
318 | } | 318 | } |
319 | 319 | ||
@@ -333,7 +333,7 @@ static int pgd_prepopulate_pmd(struct mm_struct *mm, pgd_t *pgd) | |||
333 | return 1; | 333 | return 1; |
334 | } | 334 | } |
335 | 335 | ||
336 | static void pgd_mop_up_pmds(pgd_t *pgd) | 336 | static void pgd_mop_up_pmds(struct mm_struct *mm, pgd_t *pgdp) |
337 | { | 337 | { |
338 | } | 338 | } |
339 | #endif /* CONFIG_X86_PAE */ | 339 | #endif /* CONFIG_X86_PAE */ |
@@ -352,9 +352,9 @@ pgd_t *pgd_alloc(struct mm_struct *mm) | |||
352 | return pgd; | 352 | return pgd; |
353 | } | 353 | } |
354 | 354 | ||
355 | void pgd_free(pgd_t *pgd) | 355 | void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
356 | { | 356 | { |
357 | pgd_mop_up_pmds(pgd); | 357 | pgd_mop_up_pmds(mm, pgd); |
358 | quicklist_free(0, pgd_dtor, pgd); | 358 | quicklist_free(0, pgd_dtor, pgd); |
359 | } | 359 | } |
360 | 360 | ||
diff --git a/include/asm-alpha/pgalloc.h b/include/asm-alpha/pgalloc.h index 471864e8d4c3..fdbedacc7375 100644 --- a/include/asm-alpha/pgalloc.h +++ b/include/asm-alpha/pgalloc.h | |||
@@ -31,7 +31,7 @@ pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd) | |||
31 | extern pgd_t *pgd_alloc(struct mm_struct *mm); | 31 | extern pgd_t *pgd_alloc(struct mm_struct *mm); |
32 | 32 | ||
33 | static inline void | 33 | static inline void |
34 | pgd_free(pgd_t *pgd) | 34 | pgd_free(struct mm_struct *mm, pgd_t *pgd) |
35 | { | 35 | { |
36 | free_page((unsigned long)pgd); | 36 | free_page((unsigned long)pgd); |
37 | } | 37 | } |
@@ -44,7 +44,7 @@ pmd_alloc_one(struct mm_struct *mm, unsigned long address) | |||
44 | } | 44 | } |
45 | 45 | ||
46 | static inline void | 46 | static inline void |
47 | pmd_free(pmd_t *pmd) | 47 | pmd_free(struct mm_struct *mm, pmd_t *pmd) |
48 | { | 48 | { |
49 | free_page((unsigned long)pmd); | 49 | free_page((unsigned long)pmd); |
50 | } | 50 | } |
@@ -52,7 +52,7 @@ pmd_free(pmd_t *pmd) | |||
52 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); | 52 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); |
53 | 53 | ||
54 | static inline void | 54 | static inline void |
55 | pte_free_kernel(pte_t *pte) | 55 | pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
56 | { | 56 | { |
57 | free_page((unsigned long)pte); | 57 | free_page((unsigned long)pte); |
58 | } | 58 | } |
@@ -67,7 +67,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
67 | } | 67 | } |
68 | 68 | ||
69 | static inline void | 69 | static inline void |
70 | pte_free(struct page *page) | 70 | pte_free(struct mm_struct *mm, struct page *page) |
71 | { | 71 | { |
72 | __free_page(page); | 72 | __free_page(page); |
73 | } | 73 | } |
diff --git a/include/asm-alpha/tlb.h b/include/asm-alpha/tlb.h index aa91335533e0..c13636575fba 100644 --- a/include/asm-alpha/tlb.h +++ b/include/asm-alpha/tlb.h | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | #include <asm-generic/tlb.h> | 10 | #include <asm-generic/tlb.h> |
11 | 11 | ||
12 | #define __pte_free_tlb(tlb,pte) pte_free(pte) | 12 | #define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte) |
13 | #define __pmd_free_tlb(tlb,pmd) pmd_free(pmd) | 13 | #define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd) |
14 | 14 | ||
15 | #endif | 15 | #endif |
diff --git a/include/asm-arm/pgalloc.h b/include/asm-arm/pgalloc.h index 4d4394552911..fb6c6e3222bd 100644 --- a/include/asm-arm/pgalloc.h +++ b/include/asm-arm/pgalloc.h | |||
@@ -27,14 +27,14 @@ | |||
27 | * Since we have only two-level page tables, these are trivial | 27 | * Since we have only two-level page tables, these are trivial |
28 | */ | 28 | */ |
29 | #define pmd_alloc_one(mm,addr) ({ BUG(); ((pmd_t *)2); }) | 29 | #define pmd_alloc_one(mm,addr) ({ BUG(); ((pmd_t *)2); }) |
30 | #define pmd_free(pmd) do { } while (0) | 30 | #define pmd_free(mm, pmd) do { } while (0) |
31 | #define pgd_populate(mm,pmd,pte) BUG() | 31 | #define pgd_populate(mm,pmd,pte) BUG() |
32 | 32 | ||
33 | extern pgd_t *get_pgd_slow(struct mm_struct *mm); | 33 | extern pgd_t *get_pgd_slow(struct mm_struct *mm); |
34 | extern void free_pgd_slow(pgd_t *pgd); | 34 | extern void free_pgd_slow(struct mm_struct *mm, pgd_t *pgd); |
35 | 35 | ||
36 | #define pgd_alloc(mm) get_pgd_slow(mm) | 36 | #define pgd_alloc(mm) get_pgd_slow(mm) |
37 | #define pgd_free(pgd) free_pgd_slow(pgd) | 37 | #define pgd_free(mm, pgd) free_pgd_slow(mm, pgd) |
38 | 38 | ||
39 | /* | 39 | /* |
40 | * Allocate one PTE table. | 40 | * Allocate one PTE table. |
@@ -83,7 +83,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
83 | /* | 83 | /* |
84 | * Free one PTE table. | 84 | * Free one PTE table. |
85 | */ | 85 | */ |
86 | static inline void pte_free_kernel(pte_t *pte) | 86 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
87 | { | 87 | { |
88 | if (pte) { | 88 | if (pte) { |
89 | pte -= PTRS_PER_PTE; | 89 | pte -= PTRS_PER_PTE; |
@@ -91,7 +91,7 @@ static inline void pte_free_kernel(pte_t *pte) | |||
91 | } | 91 | } |
92 | } | 92 | } |
93 | 93 | ||
94 | static inline void pte_free(struct page *pte) | 94 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
95 | { | 95 | { |
96 | __free_page(pte); | 96 | __free_page(pte); |
97 | } | 97 | } |
diff --git a/include/asm-arm/tlb.h b/include/asm-arm/tlb.h index cb740025d413..36bd402a21cb 100644 --- a/include/asm-arm/tlb.h +++ b/include/asm-arm/tlb.h | |||
@@ -85,8 +85,8 @@ tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma) | |||
85 | } | 85 | } |
86 | 86 | ||
87 | #define tlb_remove_page(tlb,page) free_page_and_swap_cache(page) | 87 | #define tlb_remove_page(tlb,page) free_page_and_swap_cache(page) |
88 | #define pte_free_tlb(tlb,ptep) pte_free(ptep) | 88 | #define pte_free_tlb(tlb, ptep) pte_free((tlb)->mm, ptep) |
89 | #define pmd_free_tlb(tlb,pmdp) pmd_free(pmdp) | 89 | #define pmd_free_tlb(tlb, pmdp) pmd_free((tlb)->mm, pmdp) |
90 | 90 | ||
91 | #define tlb_migrate_finish(mm) do { } while (0) | 91 | #define tlb_migrate_finish(mm) do { } while (0) |
92 | 92 | ||
diff --git a/include/asm-avr32/pgalloc.h b/include/asm-avr32/pgalloc.h index 0e680f47209f..b77e364b4c44 100644 --- a/include/asm-avr32/pgalloc.h +++ b/include/asm-avr32/pgalloc.h | |||
@@ -30,7 +30,7 @@ static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm) | |||
30 | return kcalloc(USER_PTRS_PER_PGD, sizeof(pgd_t), GFP_KERNEL); | 30 | return kcalloc(USER_PTRS_PER_PGD, sizeof(pgd_t), GFP_KERNEL); |
31 | } | 31 | } |
32 | 32 | ||
33 | static inline void pgd_free(pgd_t *pgd) | 33 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
34 | { | 34 | { |
35 | kfree(pgd); | 35 | kfree(pgd); |
36 | } | 36 | } |
@@ -55,12 +55,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, | |||
55 | return pte; | 55 | return pte; |
56 | } | 56 | } |
57 | 57 | ||
58 | static inline void pte_free_kernel(pte_t *pte) | 58 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
59 | { | 59 | { |
60 | free_page((unsigned long)pte); | 60 | free_page((unsigned long)pte); |
61 | } | 61 | } |
62 | 62 | ||
63 | static inline void pte_free(struct page *pte) | 63 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
64 | { | 64 | { |
65 | __free_page(pte); | 65 | __free_page(pte); |
66 | } | 66 | } |
diff --git a/include/asm-cris/pgalloc.h b/include/asm-cris/pgalloc.h index deaddfe79bbc..8ddd66f81773 100644 --- a/include/asm-cris/pgalloc.h +++ b/include/asm-cris/pgalloc.h | |||
@@ -16,7 +16,7 @@ static inline pgd_t *pgd_alloc (struct mm_struct *mm) | |||
16 | return (pgd_t *)get_zeroed_page(GFP_KERNEL); | 16 | return (pgd_t *)get_zeroed_page(GFP_KERNEL); |
17 | } | 17 | } |
18 | 18 | ||
19 | static inline void pgd_free (pgd_t *pgd) | 19 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
20 | { | 20 | { |
21 | free_page((unsigned long)pgd); | 21 | free_page((unsigned long)pgd); |
22 | } | 22 | } |
@@ -34,12 +34,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long add | |||
34 | return pte; | 34 | return pte; |
35 | } | 35 | } |
36 | 36 | ||
37 | static inline void pte_free_kernel(pte_t *pte) | 37 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
38 | { | 38 | { |
39 | free_page((unsigned long)pte); | 39 | free_page((unsigned long)pte); |
40 | } | 40 | } |
41 | 41 | ||
42 | static inline void pte_free(struct page *pte) | 42 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
43 | { | 43 | { |
44 | __free_page(pte); | 44 | __free_page(pte); |
45 | } | 45 | } |
diff --git a/include/asm-frv/pgalloc.h b/include/asm-frv/pgalloc.h index ce982a6c610f..e89620ef08ca 100644 --- a/include/asm-frv/pgalloc.h +++ b/include/asm-frv/pgalloc.h | |||
@@ -31,18 +31,18 @@ do { \ | |||
31 | */ | 31 | */ |
32 | 32 | ||
33 | extern pgd_t *pgd_alloc(struct mm_struct *); | 33 | extern pgd_t *pgd_alloc(struct mm_struct *); |
34 | extern void pgd_free(pgd_t *); | 34 | extern void pgd_free(struct mm_struct *mm, pgd_t *); |
35 | 35 | ||
36 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); | 36 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); |
37 | 37 | ||
38 | extern struct page *pte_alloc_one(struct mm_struct *, unsigned long); | 38 | extern struct page *pte_alloc_one(struct mm_struct *, unsigned long); |
39 | 39 | ||
40 | static inline void pte_free_kernel(pte_t *pte) | 40 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
41 | { | 41 | { |
42 | free_page((unsigned long)pte); | 42 | free_page((unsigned long)pte); |
43 | } | 43 | } |
44 | 44 | ||
45 | static inline void pte_free(struct page *pte) | 45 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
46 | { | 46 | { |
47 | __free_page(pte); | 47 | __free_page(pte); |
48 | } | 48 | } |
@@ -55,7 +55,7 @@ static inline void pte_free(struct page *pte) | |||
55 | * (In the PAE case we free the pmds as part of the pgd.) | 55 | * (In the PAE case we free the pmds as part of the pgd.) |
56 | */ | 56 | */ |
57 | #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *) 2); }) | 57 | #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *) 2); }) |
58 | #define pmd_free(x) do { } while (0) | 58 | #define pmd_free(mm, x) do { } while (0) |
59 | #define __pmd_free_tlb(tlb,x) do { } while (0) | 59 | #define __pmd_free_tlb(tlb,x) do { } while (0) |
60 | 60 | ||
61 | #endif /* CONFIG_MMU */ | 61 | #endif /* CONFIG_MMU */ |
diff --git a/include/asm-frv/pgtable.h b/include/asm-frv/pgtable.h index 3c402afb9e74..6c0682ed5fc9 100644 --- a/include/asm-frv/pgtable.h +++ b/include/asm-frv/pgtable.h | |||
@@ -226,7 +226,7 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address) | |||
226 | * inside the pgd, so has no extra memory associated with it. | 226 | * inside the pgd, so has no extra memory associated with it. |
227 | */ | 227 | */ |
228 | #define pud_alloc_one(mm, address) NULL | 228 | #define pud_alloc_one(mm, address) NULL |
229 | #define pud_free(x) do { } while (0) | 229 | #define pud_free(mm, x) do { } while (0) |
230 | #define __pud_free_tlb(tlb, x) do { } while (0) | 230 | #define __pud_free_tlb(tlb, x) do { } while (0) |
231 | 231 | ||
232 | /* | 232 | /* |
diff --git a/include/asm-generic/4level-fixup.h b/include/asm-generic/4level-fixup.h index 7b88d3931e34..9d40e879f99e 100644 --- a/include/asm-generic/4level-fixup.h +++ b/include/asm-generic/4level-fixup.h | |||
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | #undef pud_free_tlb | 29 | #undef pud_free_tlb |
30 | #define pud_free_tlb(tlb, x) do { } while (0) | 30 | #define pud_free_tlb(tlb, x) do { } while (0) |
31 | #define pud_free(x) do { } while (0) | 31 | #define pud_free(mm, x) do { } while (0) |
32 | #define __pud_free_tlb(tlb, x) do { } while (0) | 32 | #define __pud_free_tlb(tlb, x) do { } while (0) |
33 | 33 | ||
34 | #undef pud_addr_end | 34 | #undef pud_addr_end |
diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h index 29ff5d84d8c3..087325ede76c 100644 --- a/include/asm-generic/pgtable-nopmd.h +++ b/include/asm-generic/pgtable-nopmd.h | |||
@@ -54,7 +54,7 @@ static inline pmd_t * pmd_offset(pud_t * pud, unsigned long address) | |||
54 | * inside the pud, so has no extra memory associated with it. | 54 | * inside the pud, so has no extra memory associated with it. |
55 | */ | 55 | */ |
56 | #define pmd_alloc_one(mm, address) NULL | 56 | #define pmd_alloc_one(mm, address) NULL |
57 | #define pmd_free(x) do { } while (0) | 57 | #define pmd_free(mm, x) do { } while (0) |
58 | #define __pmd_free_tlb(tlb, x) do { } while (0) | 58 | #define __pmd_free_tlb(tlb, x) do { } while (0) |
59 | 59 | ||
60 | #undef pmd_addr_end | 60 | #undef pmd_addr_end |
diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h index 566464500558..87cf449a6df3 100644 --- a/include/asm-generic/pgtable-nopud.h +++ b/include/asm-generic/pgtable-nopud.h | |||
@@ -51,7 +51,7 @@ static inline pud_t * pud_offset(pgd_t * pgd, unsigned long address) | |||
51 | * inside the pgd, so has no extra memory associated with it. | 51 | * inside the pgd, so has no extra memory associated with it. |
52 | */ | 52 | */ |
53 | #define pud_alloc_one(mm, address) NULL | 53 | #define pud_alloc_one(mm, address) NULL |
54 | #define pud_free(x) do { } while (0) | 54 | #define pud_free(mm, x) do { } while (0) |
55 | #define __pud_free_tlb(tlb, x) do { } while (0) | 55 | #define __pud_free_tlb(tlb, x) do { } while (0) |
56 | 56 | ||
57 | #undef pud_addr_end | 57 | #undef pud_addr_end |
diff --git a/include/asm-ia64/pgalloc.h b/include/asm-ia64/pgalloc.h index 67552cad5173..556d988123ac 100644 --- a/include/asm-ia64/pgalloc.h +++ b/include/asm-ia64/pgalloc.h | |||
@@ -27,7 +27,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
27 | return quicklist_alloc(0, GFP_KERNEL, NULL); | 27 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
28 | } | 28 | } |
29 | 29 | ||
30 | static inline void pgd_free(pgd_t * pgd) | 30 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
31 | { | 31 | { |
32 | quicklist_free(0, NULL, pgd); | 32 | quicklist_free(0, NULL, pgd); |
33 | } | 33 | } |
@@ -44,11 +44,11 @@ static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
44 | return quicklist_alloc(0, GFP_KERNEL, NULL); | 44 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
45 | } | 45 | } |
46 | 46 | ||
47 | static inline void pud_free(pud_t * pud) | 47 | static inline void pud_free(struct mm_struct *mm, pud_t *pud) |
48 | { | 48 | { |
49 | quicklist_free(0, NULL, pud); | 49 | quicklist_free(0, NULL, pud); |
50 | } | 50 | } |
51 | #define __pud_free_tlb(tlb, pud) pud_free(pud) | 51 | #define __pud_free_tlb(tlb, pud) pud_free((tlb)->mm, pud) |
52 | #endif /* CONFIG_PGTABLE_4 */ | 52 | #endif /* CONFIG_PGTABLE_4 */ |
53 | 53 | ||
54 | static inline void | 54 | static inline void |
@@ -62,12 +62,12 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
62 | return quicklist_alloc(0, GFP_KERNEL, NULL); | 62 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
63 | } | 63 | } |
64 | 64 | ||
65 | static inline void pmd_free(pmd_t * pmd) | 65 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
66 | { | 66 | { |
67 | quicklist_free(0, NULL, pmd); | 67 | quicklist_free(0, NULL, pmd); |
68 | } | 68 | } |
69 | 69 | ||
70 | #define __pmd_free_tlb(tlb, pmd) pmd_free(pmd) | 70 | #define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd) |
71 | 71 | ||
72 | static inline void | 72 | static inline void |
73 | pmd_populate(struct mm_struct *mm, pmd_t * pmd_entry, struct page *pte) | 73 | pmd_populate(struct mm_struct *mm, pmd_t * pmd_entry, struct page *pte) |
@@ -94,12 +94,12 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | |||
94 | return quicklist_alloc(0, GFP_KERNEL, NULL); | 94 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
95 | } | 95 | } |
96 | 96 | ||
97 | static inline void pte_free(struct page *pte) | 97 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
98 | { | 98 | { |
99 | quicklist_free_page(0, NULL, pte); | 99 | quicklist_free_page(0, NULL, pte); |
100 | } | 100 | } |
101 | 101 | ||
102 | static inline void pte_free_kernel(pte_t * pte) | 102 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
103 | { | 103 | { |
104 | quicklist_free(0, NULL, pte); | 104 | quicklist_free(0, NULL, pte); |
105 | } | 105 | } |
@@ -109,6 +109,6 @@ static inline void check_pgt_cache(void) | |||
109 | quicklist_trim(0, NULL, 25, 16); | 109 | quicklist_trim(0, NULL, 25, 16); |
110 | } | 110 | } |
111 | 111 | ||
112 | #define __pte_free_tlb(tlb, pte) pte_free(pte) | 112 | #define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte) |
113 | 113 | ||
114 | #endif /* _ASM_IA64_PGALLOC_H */ | 114 | #endif /* _ASM_IA64_PGALLOC_H */ |
diff --git a/include/asm-m32r/pgalloc.h b/include/asm-m32r/pgalloc.h index 943ba63c1ebc..e5921adfad1b 100644 --- a/include/asm-m32r/pgalloc.h +++ b/include/asm-m32r/pgalloc.h | |||
@@ -24,7 +24,7 @@ static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm) | |||
24 | return pgd; | 24 | return pgd; |
25 | } | 25 | } |
26 | 26 | ||
27 | static __inline__ void pgd_free(pgd_t *pgd) | 27 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
28 | { | 28 | { |
29 | free_page((unsigned long)pgd); | 29 | free_page((unsigned long)pgd); |
30 | } | 30 | } |
@@ -46,17 +46,17 @@ static __inline__ struct page *pte_alloc_one(struct mm_struct *mm, | |||
46 | return pte; | 46 | return pte; |
47 | } | 47 | } |
48 | 48 | ||
49 | static __inline__ void pte_free_kernel(pte_t *pte) | 49 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
50 | { | 50 | { |
51 | free_page((unsigned long)pte); | 51 | free_page((unsigned long)pte); |
52 | } | 52 | } |
53 | 53 | ||
54 | static __inline__ void pte_free(struct page *pte) | 54 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
55 | { | 55 | { |
56 | __free_page(pte); | 56 | __free_page(pte); |
57 | } | 57 | } |
58 | 58 | ||
59 | #define __pte_free_tlb(tlb, pte) pte_free((pte)) | 59 | #define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, (pte)) |
60 | 60 | ||
61 | /* | 61 | /* |
62 | * allocating and freeing a pmd is trivial: the 1-entry pmd is | 62 | * allocating and freeing a pmd is trivial: the 1-entry pmd is |
@@ -65,7 +65,7 @@ static __inline__ void pte_free(struct page *pte) | |||
65 | */ | 65 | */ |
66 | 66 | ||
67 | #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) | 67 | #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) |
68 | #define pmd_free(x) do { } while (0) | 68 | #define pmd_free(mm, x) do { } while (0) |
69 | #define __pmd_free_tlb(tlb, x) do { } while (0) | 69 | #define __pmd_free_tlb(tlb, x) do { } while (0) |
70 | #define pgd_populate(mm, pmd, pte) BUG() | 70 | #define pgd_populate(mm, pmd, pte) BUG() |
71 | 71 | ||
diff --git a/include/asm-m68k/motorola_pgalloc.h b/include/asm-m68k/motorola_pgalloc.h index 5158412cd54d..500ec9b8b189 100644 --- a/include/asm-m68k/motorola_pgalloc.h +++ b/include/asm-m68k/motorola_pgalloc.h | |||
@@ -22,7 +22,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long ad | |||
22 | return pte; | 22 | return pte; |
23 | } | 23 | } |
24 | 24 | ||
25 | static inline void pte_free_kernel(pte_t *pte) | 25 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
26 | { | 26 | { |
27 | cache_page(pte); | 27 | cache_page(pte); |
28 | free_page((unsigned long) pte); | 28 | free_page((unsigned long) pte); |
@@ -47,7 +47,7 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long add | |||
47 | return page; | 47 | return page; |
48 | } | 48 | } |
49 | 49 | ||
50 | static inline void pte_free(struct page *page) | 50 | static inline void pte_free(struct mm_struct *mm, struct page *page) |
51 | { | 51 | { |
52 | cache_page(kmap(page)); | 52 | cache_page(kmap(page)); |
53 | kunmap(page); | 53 | kunmap(page); |
@@ -67,7 +67,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) | |||
67 | return get_pointer_table(); | 67 | return get_pointer_table(); |
68 | } | 68 | } |
69 | 69 | ||
70 | static inline int pmd_free(pmd_t *pmd) | 70 | static inline int pmd_free(struct mm_struct *mm, pmd_t *pmd) |
71 | { | 71 | { |
72 | return free_pointer_table(pmd); | 72 | return free_pointer_table(pmd); |
73 | } | 73 | } |
@@ -78,9 +78,9 @@ static inline int __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) | |||
78 | } | 78 | } |
79 | 79 | ||
80 | 80 | ||
81 | static inline void pgd_free(pgd_t *pgd) | 81 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
82 | { | 82 | { |
83 | pmd_free((pmd_t *)pgd); | 83 | pmd_free(mm, (pmd_t *)pgd); |
84 | } | 84 | } |
85 | 85 | ||
86 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) | 86 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) |
diff --git a/include/asm-m68k/sun3_pgalloc.h b/include/asm-m68k/sun3_pgalloc.h index fd8241117649..a5a91e72714b 100644 --- a/include/asm-m68k/sun3_pgalloc.h +++ b/include/asm-m68k/sun3_pgalloc.h | |||
@@ -21,12 +21,12 @@ extern const char bad_pmd_string[]; | |||
21 | #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) | 21 | #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) |
22 | 22 | ||
23 | 23 | ||
24 | static inline void pte_free_kernel(pte_t * pte) | 24 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
25 | { | 25 | { |
26 | free_page((unsigned long) pte); | 26 | free_page((unsigned long) pte); |
27 | } | 27 | } |
28 | 28 | ||
29 | static inline void pte_free(struct page *page) | 29 | static inline void pte_free(struct mm_struct *mm, struct page *page) |
30 | { | 30 | { |
31 | __free_page(page); | 31 | __free_page(page); |
32 | } | 32 | } |
@@ -72,10 +72,10 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *p | |||
72 | * allocating and freeing a pmd is trivial: the 1-entry pmd is | 72 | * allocating and freeing a pmd is trivial: the 1-entry pmd is |
73 | * inside the pgd, so has no extra memory associated with it. | 73 | * inside the pgd, so has no extra memory associated with it. |
74 | */ | 74 | */ |
75 | #define pmd_free(x) do { } while (0) | 75 | #define pmd_free(mm, x) do { } while (0) |
76 | #define __pmd_free_tlb(tlb, x) do { } while (0) | 76 | #define __pmd_free_tlb(tlb, x) do { } while (0) |
77 | 77 | ||
78 | static inline void pgd_free(pgd_t * pgd) | 78 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
79 | { | 79 | { |
80 | free_page((unsigned long) pgd); | 80 | free_page((unsigned long) pgd); |
81 | } | 81 | } |
diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h index 81b72122207a..c4efeced8396 100644 --- a/include/asm-mips/pgalloc.h +++ b/include/asm-mips/pgalloc.h | |||
@@ -58,7 +58,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
58 | return ret; | 58 | return ret; |
59 | } | 59 | } |
60 | 60 | ||
61 | static inline void pgd_free(pgd_t *pgd) | 61 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
62 | { | 62 | { |
63 | free_pages((unsigned long)pgd, PGD_ORDER); | 63 | free_pages((unsigned long)pgd, PGD_ORDER); |
64 | } | 64 | } |
@@ -85,12 +85,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, | |||
85 | return pte; | 85 | return pte; |
86 | } | 86 | } |
87 | 87 | ||
88 | static inline void pte_free_kernel(pte_t *pte) | 88 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
89 | { | 89 | { |
90 | free_pages((unsigned long)pte, PTE_ORDER); | 90 | free_pages((unsigned long)pte, PTE_ORDER); |
91 | } | 91 | } |
92 | 92 | ||
93 | static inline void pte_free(struct page *pte) | 93 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
94 | { | 94 | { |
95 | __free_pages(pte, PTE_ORDER); | 95 | __free_pages(pte, PTE_ORDER); |
96 | } | 96 | } |
@@ -103,7 +103,7 @@ static inline void pte_free(struct page *pte) | |||
103 | * allocating and freeing a pmd is trivial: the 1-entry pmd is | 103 | * allocating and freeing a pmd is trivial: the 1-entry pmd is |
104 | * inside the pgd, so has no extra memory associated with it. | 104 | * inside the pgd, so has no extra memory associated with it. |
105 | */ | 105 | */ |
106 | #define pmd_free(x) do { } while (0) | 106 | #define pmd_free(mm, x) do { } while (0) |
107 | #define __pmd_free_tlb(tlb, x) do { } while (0) | 107 | #define __pmd_free_tlb(tlb, x) do { } while (0) |
108 | 108 | ||
109 | #endif | 109 | #endif |
@@ -120,12 +120,12 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) | |||
120 | return pmd; | 120 | return pmd; |
121 | } | 121 | } |
122 | 122 | ||
123 | static inline void pmd_free(pmd_t *pmd) | 123 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
124 | { | 124 | { |
125 | free_pages((unsigned long)pmd, PMD_ORDER); | 125 | free_pages((unsigned long)pmd, PMD_ORDER); |
126 | } | 126 | } |
127 | 127 | ||
128 | #define __pmd_free_tlb(tlb, x) pmd_free(x) | 128 | #define __pmd_free_tlb(tlb, x) pmd_free((tlb)->mm, x) |
129 | 129 | ||
130 | #endif | 130 | #endif |
131 | 131 | ||
diff --git a/include/asm-parisc/pgalloc.h b/include/asm-parisc/pgalloc.h index 1af1a41e0723..aab66f1bea14 100644 --- a/include/asm-parisc/pgalloc.h +++ b/include/asm-parisc/pgalloc.h | |||
@@ -43,7 +43,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
43 | return actual_pgd; | 43 | return actual_pgd; |
44 | } | 44 | } |
45 | 45 | ||
46 | static inline void pgd_free(pgd_t *pgd) | 46 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
47 | { | 47 | { |
48 | #ifdef CONFIG_64BIT | 48 | #ifdef CONFIG_64BIT |
49 | pgd -= PTRS_PER_PGD; | 49 | pgd -= PTRS_PER_PGD; |
@@ -70,7 +70,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) | |||
70 | return pmd; | 70 | return pmd; |
71 | } | 71 | } |
72 | 72 | ||
73 | static inline void pmd_free(pmd_t *pmd) | 73 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
74 | { | 74 | { |
75 | #ifdef CONFIG_64BIT | 75 | #ifdef CONFIG_64BIT |
76 | if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED) | 76 | if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED) |
@@ -91,7 +91,7 @@ static inline void pmd_free(pmd_t *pmd) | |||
91 | */ | 91 | */ |
92 | 92 | ||
93 | #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) | 93 | #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) |
94 | #define pmd_free(x) do { } while (0) | 94 | #define pmd_free(mm, x) do { } while (0) |
95 | #define pgd_populate(mm, pmd, pte) BUG() | 95 | #define pgd_populate(mm, pmd, pte) BUG() |
96 | 96 | ||
97 | #endif | 97 | #endif |
@@ -130,12 +130,12 @@ pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr) | |||
130 | return pte; | 130 | return pte; |
131 | } | 131 | } |
132 | 132 | ||
133 | static inline void pte_free_kernel(pte_t *pte) | 133 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
134 | { | 134 | { |
135 | free_page((unsigned long)pte); | 135 | free_page((unsigned long)pte); |
136 | } | 136 | } |
137 | 137 | ||
138 | #define pte_free(page) pte_free_kernel(page_address(page)) | 138 | #define pte_free(mm, page) pte_free_kernel(page_address(page)) |
139 | 139 | ||
140 | #define check_pgt_cache() do { } while (0) | 140 | #define check_pgt_cache() do { } while (0) |
141 | 141 | ||
diff --git a/include/asm-parisc/tlb.h b/include/asm-parisc/tlb.h index 33107a248e1f..383b1db310ee 100644 --- a/include/asm-parisc/tlb.h +++ b/include/asm-parisc/tlb.h | |||
@@ -21,7 +21,7 @@ do { if (!(tlb)->fullmm) \ | |||
21 | 21 | ||
22 | #include <asm-generic/tlb.h> | 22 | #include <asm-generic/tlb.h> |
23 | 23 | ||
24 | #define __pmd_free_tlb(tlb, pmd) pmd_free(pmd) | 24 | #define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd) |
25 | #define __pte_free_tlb(tlb, pte) pte_free(pte) | 25 | #define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte) |
26 | 26 | ||
27 | #endif | 27 | #endif |
diff --git a/include/asm-powerpc/pgalloc-32.h b/include/asm-powerpc/pgalloc-32.h index e1307432163c..c162a4c37b39 100644 --- a/include/asm-powerpc/pgalloc-32.h +++ b/include/asm-powerpc/pgalloc-32.h | |||
@@ -6,14 +6,14 @@ | |||
6 | extern void __bad_pte(pmd_t *pmd); | 6 | extern void __bad_pte(pmd_t *pmd); |
7 | 7 | ||
8 | extern pgd_t *pgd_alloc(struct mm_struct *mm); | 8 | extern pgd_t *pgd_alloc(struct mm_struct *mm); |
9 | extern void pgd_free(pgd_t *pgd); | 9 | extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); |
10 | 10 | ||
11 | /* | 11 | /* |
12 | * We don't have any real pmd's, and this code never triggers because | 12 | * We don't have any real pmd's, and this code never triggers because |
13 | * the pgd will always be present.. | 13 | * the pgd will always be present.. |
14 | */ | 14 | */ |
15 | /* #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) */ | 15 | /* #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) */ |
16 | #define pmd_free(x) do { } while (0) | 16 | #define pmd_free(mm, x) do { } while (0) |
17 | #define __pmd_free_tlb(tlb,x) do { } while (0) | 17 | #define __pmd_free_tlb(tlb,x) do { } while (0) |
18 | /* #define pgd_populate(mm, pmd, pte) BUG() */ | 18 | /* #define pgd_populate(mm, pmd, pte) BUG() */ |
19 | 19 | ||
@@ -31,10 +31,10 @@ extern void pgd_free(pgd_t *pgd); | |||
31 | 31 | ||
32 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); | 32 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); |
33 | extern struct page *pte_alloc_one(struct mm_struct *mm, unsigned long addr); | 33 | extern struct page *pte_alloc_one(struct mm_struct *mm, unsigned long addr); |
34 | extern void pte_free_kernel(pte_t *pte); | 34 | extern void pte_free_kernel(struct mm_struct *mm, pte_t *pte); |
35 | extern void pte_free(struct page *pte); | 35 | extern void pte_free(struct mm_struct *mm, struct page *pte); |
36 | 36 | ||
37 | #define __pte_free_tlb(tlb, pte) pte_free((pte)) | 37 | #define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, (pte)) |
38 | 38 | ||
39 | #define check_pgt_cache() do { } while (0) | 39 | #define check_pgt_cache() do { } while (0) |
40 | 40 | ||
diff --git a/include/asm-powerpc/pgalloc-64.h b/include/asm-powerpc/pgalloc-64.h index 43214c8085b7..5afae8593931 100644 --- a/include/asm-powerpc/pgalloc-64.h +++ b/include/asm-powerpc/pgalloc-64.h | |||
@@ -29,7 +29,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
29 | return kmem_cache_alloc(pgtable_cache[PGD_CACHE_NUM], GFP_KERNEL); | 29 | return kmem_cache_alloc(pgtable_cache[PGD_CACHE_NUM], GFP_KERNEL); |
30 | } | 30 | } |
31 | 31 | ||
32 | static inline void pgd_free(pgd_t *pgd) | 32 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
33 | { | 33 | { |
34 | subpage_prot_free(pgd); | 34 | subpage_prot_free(pgd); |
35 | kmem_cache_free(pgtable_cache[PGD_CACHE_NUM], pgd); | 35 | kmem_cache_free(pgtable_cache[PGD_CACHE_NUM], pgd); |
@@ -45,7 +45,7 @@ static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
45 | GFP_KERNEL|__GFP_REPEAT); | 45 | GFP_KERNEL|__GFP_REPEAT); |
46 | } | 46 | } |
47 | 47 | ||
48 | static inline void pud_free(pud_t *pud) | 48 | static inline void pud_free(struct mm_struct *mm, pud_t *pud) |
49 | { | 49 | { |
50 | kmem_cache_free(pgtable_cache[PUD_CACHE_NUM], pud); | 50 | kmem_cache_free(pgtable_cache[PUD_CACHE_NUM], pud); |
51 | } | 51 | } |
@@ -81,7 +81,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
81 | GFP_KERNEL|__GFP_REPEAT); | 81 | GFP_KERNEL|__GFP_REPEAT); |
82 | } | 82 | } |
83 | 83 | ||
84 | static inline void pmd_free(pmd_t *pmd) | 84 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
85 | { | 85 | { |
86 | kmem_cache_free(pgtable_cache[PMD_CACHE_NUM], pmd); | 86 | kmem_cache_free(pgtable_cache[PMD_CACHE_NUM], pmd); |
87 | } | 87 | } |
@@ -99,12 +99,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, | |||
99 | return pte ? virt_to_page(pte) : NULL; | 99 | return pte ? virt_to_page(pte) : NULL; |
100 | } | 100 | } |
101 | 101 | ||
102 | static inline void pte_free_kernel(pte_t *pte) | 102 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
103 | { | 103 | { |
104 | free_page((unsigned long)pte); | 104 | free_page((unsigned long)pte); |
105 | } | 105 | } |
106 | 106 | ||
107 | static inline void pte_free(struct page *ptepage) | 107 | static inline void pte_free(struct mm_struct *mm, struct page *ptepage) |
108 | { | 108 | { |
109 | __free_page(ptepage); | 109 | __free_page(ptepage); |
110 | } | 110 | } |
diff --git a/include/asm-ppc/pgalloc.h b/include/asm-ppc/pgalloc.h index 44d88a98e87c..7c39a95829c7 100644 --- a/include/asm-ppc/pgalloc.h +++ b/include/asm-ppc/pgalloc.h | |||
@@ -7,14 +7,14 @@ | |||
7 | extern void __bad_pte(pmd_t *pmd); | 7 | extern void __bad_pte(pmd_t *pmd); |
8 | 8 | ||
9 | extern pgd_t *pgd_alloc(struct mm_struct *mm); | 9 | extern pgd_t *pgd_alloc(struct mm_struct *mm); |
10 | extern void pgd_free(pgd_t *pgd); | 10 | extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); |
11 | 11 | ||
12 | /* | 12 | /* |
13 | * We don't have any real pmd's, and this code never triggers because | 13 | * We don't have any real pmd's, and this code never triggers because |
14 | * the pgd will always be present.. | 14 | * the pgd will always be present.. |
15 | */ | 15 | */ |
16 | #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) | 16 | #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) |
17 | #define pmd_free(x) do { } while (0) | 17 | #define pmd_free(mm, x) do { } while (0) |
18 | #define __pmd_free_tlb(tlb,x) do { } while (0) | 18 | #define __pmd_free_tlb(tlb,x) do { } while (0) |
19 | #define pgd_populate(mm, pmd, pte) BUG() | 19 | #define pgd_populate(mm, pmd, pte) BUG() |
20 | 20 | ||
@@ -32,10 +32,10 @@ extern void pgd_free(pgd_t *pgd); | |||
32 | 32 | ||
33 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); | 33 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); |
34 | extern struct page *pte_alloc_one(struct mm_struct *mm, unsigned long addr); | 34 | extern struct page *pte_alloc_one(struct mm_struct *mm, unsigned long addr); |
35 | extern void pte_free_kernel(pte_t *pte); | 35 | extern void pte_free_kernel(struct mm_struct *mm, pte_t *pte); |
36 | extern void pte_free(struct page *pte); | 36 | extern void pte_free(struct mm_struct *mm, struct page *pte); |
37 | 37 | ||
38 | #define __pte_free_tlb(tlb, pte) pte_free((pte)) | 38 | #define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, (pte)) |
39 | 39 | ||
40 | #define check_pgt_cache() do { } while (0) | 40 | #define check_pgt_cache() do { } while (0) |
41 | 41 | ||
diff --git a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h index 709dd1740956..6f6619ba8980 100644 --- a/include/asm-s390/pgalloc.h +++ b/include/asm-s390/pgalloc.h | |||
@@ -57,10 +57,10 @@ static inline unsigned long pgd_entry_type(struct mm_struct *mm) | |||
57 | } | 57 | } |
58 | 58 | ||
59 | #define pud_alloc_one(mm,address) ({ BUG(); ((pud_t *)2); }) | 59 | #define pud_alloc_one(mm,address) ({ BUG(); ((pud_t *)2); }) |
60 | #define pud_free(x) do { } while (0) | 60 | #define pud_free(mm, x) do { } while (0) |
61 | 61 | ||
62 | #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) | 62 | #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) |
63 | #define pmd_free(x) do { } while (0) | 63 | #define pmd_free(mm, x) do { } while (0) |
64 | 64 | ||
65 | #define pgd_populate(mm, pgd, pud) BUG() | 65 | #define pgd_populate(mm, pgd, pud) BUG() |
66 | #define pgd_populate_kernel(mm, pgd, pud) BUG() | 66 | #define pgd_populate_kernel(mm, pgd, pud) BUG() |
@@ -76,7 +76,7 @@ static inline unsigned long pgd_entry_type(struct mm_struct *mm) | |||
76 | } | 76 | } |
77 | 77 | ||
78 | #define pud_alloc_one(mm,address) ({ BUG(); ((pud_t *)2); }) | 78 | #define pud_alloc_one(mm,address) ({ BUG(); ((pud_t *)2); }) |
79 | #define pud_free(x) do { } while (0) | 79 | #define pud_free(mm, x) do { } while (0) |
80 | 80 | ||
81 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr) | 81 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr) |
82 | { | 82 | { |
@@ -85,7 +85,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr) | |||
85 | crst_table_init(crst, _SEGMENT_ENTRY_EMPTY); | 85 | crst_table_init(crst, _SEGMENT_ENTRY_EMPTY); |
86 | return (pmd_t *) crst; | 86 | return (pmd_t *) crst; |
87 | } | 87 | } |
88 | #define pmd_free(pmd) crst_table_free((unsigned long *) pmd) | 88 | #define pmd_free(mm, pmd) crst_table_free((unsigned long *)pmd) |
89 | 89 | ||
90 | #define pgd_populate(mm, pgd, pud) BUG() | 90 | #define pgd_populate(mm, pgd, pud) BUG() |
91 | #define pgd_populate_kernel(mm, pgd, pud) BUG() | 91 | #define pgd_populate_kernel(mm, pgd, pud) BUG() |
@@ -115,7 +115,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
115 | crst_table_init(crst, pgd_entry_type(mm)); | 115 | crst_table_init(crst, pgd_entry_type(mm)); |
116 | return (pgd_t *) crst; | 116 | return (pgd_t *) crst; |
117 | } | 117 | } |
118 | #define pgd_free(pgd) crst_table_free((unsigned long *) pgd) | 118 | #define pgd_free(mm, pgd) crst_table_free((unsigned long *) pgd) |
119 | 119 | ||
120 | static inline void | 120 | static inline void |
121 | pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) | 121 | pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) |
@@ -151,9 +151,9 @@ pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *page) | |||
151 | #define pte_alloc_one(mm, vmaddr) \ | 151 | #define pte_alloc_one(mm, vmaddr) \ |
152 | virt_to_page(page_table_alloc(s390_noexec)) | 152 | virt_to_page(page_table_alloc(s390_noexec)) |
153 | 153 | ||
154 | #define pte_free_kernel(pte) \ | 154 | #define pte_free_kernel(mm, pte) \ |
155 | page_table_free((unsigned long *) pte) | 155 | page_table_free((unsigned long *) pte) |
156 | #define pte_free(pte) \ | 156 | #define pte_free(mm, pte) \ |
157 | page_table_free((unsigned long *) page_to_phys((struct page *) pte)) | 157 | page_table_free((unsigned long *) page_to_phys((struct page *) pte)) |
158 | 158 | ||
159 | #endif /* _S390_PGALLOC_H */ | 159 | #endif /* _S390_PGALLOC_H */ |
diff --git a/include/asm-s390/tlb.h b/include/asm-s390/tlb.h index 618693cfc10f..985de2b88279 100644 --- a/include/asm-s390/tlb.h +++ b/include/asm-s390/tlb.h | |||
@@ -65,9 +65,9 @@ static inline void tlb_flush_mmu(struct mmu_gather *tlb, | |||
65 | if (!tlb->fullmm && (tlb->nr_ptes > 0 || tlb->nr_pmds < TLB_NR_PTRS)) | 65 | if (!tlb->fullmm && (tlb->nr_ptes > 0 || tlb->nr_pmds < TLB_NR_PTRS)) |
66 | __tlb_flush_mm(tlb->mm); | 66 | __tlb_flush_mm(tlb->mm); |
67 | while (tlb->nr_ptes > 0) | 67 | while (tlb->nr_ptes > 0) |
68 | pte_free(tlb->array[--tlb->nr_ptes]); | 68 | pte_free(tlb->mm, tlb->array[--tlb->nr_ptes]); |
69 | while (tlb->nr_pmds < TLB_NR_PTRS) | 69 | while (tlb->nr_pmds < TLB_NR_PTRS) |
70 | pmd_free((pmd_t *) tlb->array[tlb->nr_pmds++]); | 70 | pmd_free(tlb->mm, (pmd_t *) tlb->array[tlb->nr_pmds++]); |
71 | } | 71 | } |
72 | 72 | ||
73 | static inline void tlb_finish_mmu(struct mmu_gather *tlb, | 73 | static inline void tlb_finish_mmu(struct mmu_gather *tlb, |
@@ -102,7 +102,7 @@ static inline void pte_free_tlb(struct mmu_gather *tlb, struct page *page) | |||
102 | if (tlb->nr_ptes >= tlb->nr_pmds) | 102 | if (tlb->nr_ptes >= tlb->nr_pmds) |
103 | tlb_flush_mmu(tlb, 0, 0); | 103 | tlb_flush_mmu(tlb, 0, 0); |
104 | } else | 104 | } else |
105 | pte_free(page); | 105 | pte_free(tlb->mm, page); |
106 | } | 106 | } |
107 | 107 | ||
108 | /* | 108 | /* |
@@ -117,7 +117,7 @@ static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) | |||
117 | if (tlb->nr_ptes >= tlb->nr_pmds) | 117 | if (tlb->nr_ptes >= tlb->nr_pmds) |
118 | tlb_flush_mmu(tlb, 0, 0); | 118 | tlb_flush_mmu(tlb, 0, 0); |
119 | } else | 119 | } else |
120 | pmd_free(pmd); | 120 | pmd_free(tlb->mm, pmd); |
121 | #endif | 121 | #endif |
122 | } | 122 | } |
123 | 123 | ||
diff --git a/include/asm-sh/pgalloc.h b/include/asm-sh/pgalloc.h index 18b613c57cf5..59ca16d77a1d 100644 --- a/include/asm-sh/pgalloc.h +++ b/include/asm-sh/pgalloc.h | |||
@@ -36,7 +36,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
36 | return quicklist_alloc(QUICK_PGD, GFP_KERNEL | __GFP_REPEAT, pgd_ctor); | 36 | return quicklist_alloc(QUICK_PGD, GFP_KERNEL | __GFP_REPEAT, pgd_ctor); |
37 | } | 37 | } |
38 | 38 | ||
39 | static inline void pgd_free(pgd_t *pgd) | 39 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
40 | { | 40 | { |
41 | quicklist_free(QUICK_PGD, NULL, pgd); | 41 | quicklist_free(QUICK_PGD, NULL, pgd); |
42 | } | 42 | } |
@@ -54,12 +54,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, | |||
54 | return pg ? virt_to_page(pg) : NULL; | 54 | return pg ? virt_to_page(pg) : NULL; |
55 | } | 55 | } |
56 | 56 | ||
57 | static inline void pte_free_kernel(pte_t *pte) | 57 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
58 | { | 58 | { |
59 | quicklist_free(QUICK_PT, NULL, pte); | 59 | quicklist_free(QUICK_PT, NULL, pte); |
60 | } | 60 | } |
61 | 61 | ||
62 | static inline void pte_free(struct page *pte) | 62 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
63 | { | 63 | { |
64 | quicklist_free_page(QUICK_PT, NULL, pte); | 64 | quicklist_free_page(QUICK_PT, NULL, pte); |
65 | } | 65 | } |
@@ -71,7 +71,7 @@ static inline void pte_free(struct page *pte) | |||
71 | * inside the pgd, so has no extra memory associated with it. | 71 | * inside the pgd, so has no extra memory associated with it. |
72 | */ | 72 | */ |
73 | 73 | ||
74 | #define pmd_free(x) do { } while (0) | 74 | #define pmd_free(mm, x) do { } while (0) |
75 | #define __pmd_free_tlb(tlb,x) do { } while (0) | 75 | #define __pmd_free_tlb(tlb,x) do { } while (0) |
76 | 76 | ||
77 | static inline void check_pgt_cache(void) | 77 | static inline void check_pgt_cache(void) |
diff --git a/include/asm-sparc/pgalloc.h b/include/asm-sparc/pgalloc.h index a449cd4912d1..b5fbdd36447f 100644 --- a/include/asm-sparc/pgalloc.h +++ b/include/asm-sparc/pgalloc.h | |||
@@ -32,7 +32,7 @@ BTFIXUPDEF_CALL(pgd_t *, get_pgd_fast, void) | |||
32 | BTFIXUPDEF_CALL(void, free_pgd_fast, pgd_t *) | 32 | BTFIXUPDEF_CALL(void, free_pgd_fast, pgd_t *) |
33 | #define free_pgd_fast(pgd) BTFIXUP_CALL(free_pgd_fast)(pgd) | 33 | #define free_pgd_fast(pgd) BTFIXUP_CALL(free_pgd_fast)(pgd) |
34 | 34 | ||
35 | #define pgd_free(pgd) free_pgd_fast(pgd) | 35 | #define pgd_free(mm, pgd) free_pgd_fast(pgd) |
36 | #define pgd_alloc(mm) get_pgd_fast() | 36 | #define pgd_alloc(mm) get_pgd_fast() |
37 | 37 | ||
38 | BTFIXUPDEF_CALL(void, pgd_set, pgd_t *, pmd_t *) | 38 | BTFIXUPDEF_CALL(void, pgd_set, pgd_t *, pmd_t *) |
@@ -45,8 +45,8 @@ BTFIXUPDEF_CALL(pmd_t *, pmd_alloc_one, struct mm_struct *, unsigned long) | |||
45 | BTFIXUPDEF_CALL(void, free_pmd_fast, pmd_t *) | 45 | BTFIXUPDEF_CALL(void, free_pmd_fast, pmd_t *) |
46 | #define free_pmd_fast(pmd) BTFIXUP_CALL(free_pmd_fast)(pmd) | 46 | #define free_pmd_fast(pmd) BTFIXUP_CALL(free_pmd_fast)(pmd) |
47 | 47 | ||
48 | #define pmd_free(pmd) free_pmd_fast(pmd) | 48 | #define pmd_free(mm, pmd) free_pmd_fast(pmd) |
49 | #define __pmd_free_tlb(tlb, pmd) pmd_free(pmd) | 49 | #define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd) |
50 | 50 | ||
51 | BTFIXUPDEF_CALL(void, pmd_populate, pmd_t *, struct page *) | 51 | BTFIXUPDEF_CALL(void, pmd_populate, pmd_t *, struct page *) |
52 | #define pmd_populate(MM, PMD, PTE) BTFIXUP_CALL(pmd_populate)(PMD, PTE) | 52 | #define pmd_populate(MM, PMD, PTE) BTFIXUP_CALL(pmd_populate)(PMD, PTE) |
@@ -59,10 +59,10 @@ BTFIXUPDEF_CALL(pte_t *, pte_alloc_one_kernel, struct mm_struct *, unsigned long | |||
59 | #define pte_alloc_one_kernel(mm, addr) BTFIXUP_CALL(pte_alloc_one_kernel)(mm, addr) | 59 | #define pte_alloc_one_kernel(mm, addr) BTFIXUP_CALL(pte_alloc_one_kernel)(mm, addr) |
60 | 60 | ||
61 | BTFIXUPDEF_CALL(void, free_pte_fast, pte_t *) | 61 | BTFIXUPDEF_CALL(void, free_pte_fast, pte_t *) |
62 | #define pte_free_kernel(pte) BTFIXUP_CALL(free_pte_fast)(pte) | 62 | #define pte_free_kernel(mm, pte) BTFIXUP_CALL(free_pte_fast)(pte) |
63 | 63 | ||
64 | BTFIXUPDEF_CALL(void, pte_free, struct page *) | 64 | BTFIXUPDEF_CALL(void, pte_free, struct page *) |
65 | #define pte_free(pte) BTFIXUP_CALL(pte_free)(pte) | 65 | #define pte_free(mm, pte) BTFIXUP_CALL(pte_free)(pte) |
66 | #define __pte_free_tlb(tlb, pte) pte_free(pte) | 66 | #define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte) |
67 | 67 | ||
68 | #endif /* _SPARC_PGALLOC_H */ | 68 | #endif /* _SPARC_PGALLOC_H */ |
diff --git a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h index 5d66b858a965..b48f73c2274e 100644 --- a/include/asm-sparc64/pgalloc.h +++ b/include/asm-sparc64/pgalloc.h | |||
@@ -20,7 +20,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
20 | return quicklist_alloc(0, GFP_KERNEL, NULL); | 20 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
21 | } | 21 | } |
22 | 22 | ||
23 | static inline void pgd_free(pgd_t *pgd) | 23 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
24 | { | 24 | { |
25 | quicklist_free(0, NULL, pgd); | 25 | quicklist_free(0, NULL, pgd); |
26 | } | 26 | } |
@@ -32,7 +32,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
32 | return quicklist_alloc(0, GFP_KERNEL, NULL); | 32 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
33 | } | 33 | } |
34 | 34 | ||
35 | static inline void pmd_free(pmd_t *pmd) | 35 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
36 | { | 36 | { |
37 | quicklist_free(0, NULL, pmd); | 37 | quicklist_free(0, NULL, pmd); |
38 | } | 38 | } |
@@ -50,12 +50,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, | |||
50 | return pg ? virt_to_page(pg) : NULL; | 50 | return pg ? virt_to_page(pg) : NULL; |
51 | } | 51 | } |
52 | 52 | ||
53 | static inline void pte_free_kernel(pte_t *pte) | 53 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
54 | { | 54 | { |
55 | quicklist_free(0, NULL, pte); | 55 | quicklist_free(0, NULL, pte); |
56 | } | 56 | } |
57 | 57 | ||
58 | static inline void pte_free(struct page *ptepage) | 58 | static inline void pte_free(struct mm_struct *mm, struct page *ptepage) |
59 | { | 59 | { |
60 | quicklist_free_page(0, NULL, ptepage); | 60 | quicklist_free_page(0, NULL, ptepage); |
61 | } | 61 | } |
diff --git a/include/asm-sparc64/tlb.h b/include/asm-sparc64/tlb.h index 349d1d3e9c27..ec81cdedef2c 100644 --- a/include/asm-sparc64/tlb.h +++ b/include/asm-sparc64/tlb.h | |||
@@ -100,8 +100,8 @@ static inline void tlb_remove_page(struct mmu_gather *mp, struct page *page) | |||
100 | } | 100 | } |
101 | 101 | ||
102 | #define tlb_remove_tlb_entry(mp,ptep,addr) do { } while (0) | 102 | #define tlb_remove_tlb_entry(mp,ptep,addr) do { } while (0) |
103 | #define pte_free_tlb(mp,ptepage) pte_free(ptepage) | 103 | #define pte_free_tlb(mp, ptepage) pte_free((mp)->mm, ptepage) |
104 | #define pmd_free_tlb(mp,pmdp) pmd_free(pmdp) | 104 | #define pmd_free_tlb(mp, pmdp) pmd_free((mp)->mm, pmdp) |
105 | #define pud_free_tlb(tlb,pudp) __pud_free_tlb(tlb,pudp) | 105 | #define pud_free_tlb(tlb,pudp) __pud_free_tlb(tlb,pudp) |
106 | 106 | ||
107 | #define tlb_migrate_finish(mm) do { } while (0) | 107 | #define tlb_migrate_finish(mm) do { } while (0) |
diff --git a/include/asm-um/pgalloc.h b/include/asm-um/pgalloc.h index 14904876e8fb..4f3e62b02861 100644 --- a/include/asm-um/pgalloc.h +++ b/include/asm-um/pgalloc.h | |||
@@ -23,17 +23,17 @@ | |||
23 | * Allocate and free page tables. | 23 | * Allocate and free page tables. |
24 | */ | 24 | */ |
25 | extern pgd_t *pgd_alloc(struct mm_struct *); | 25 | extern pgd_t *pgd_alloc(struct mm_struct *); |
26 | extern void pgd_free(pgd_t *pgd); | 26 | extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); |
27 | 27 | ||
28 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); | 28 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); |
29 | extern struct page *pte_alloc_one(struct mm_struct *, unsigned long); | 29 | extern struct page *pte_alloc_one(struct mm_struct *, unsigned long); |
30 | 30 | ||
31 | static inline void pte_free_kernel(pte_t *pte) | 31 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
32 | { | 32 | { |
33 | free_page((unsigned long) pte); | 33 | free_page((unsigned long) pte); |
34 | } | 34 | } |
35 | 35 | ||
36 | static inline void pte_free(struct page *pte) | 36 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
37 | { | 37 | { |
38 | __free_page(pte); | 38 | __free_page(pte); |
39 | } | 39 | } |
@@ -42,7 +42,7 @@ static inline void pte_free(struct page *pte) | |||
42 | 42 | ||
43 | #ifdef CONFIG_3_LEVEL_PGTABLES | 43 | #ifdef CONFIG_3_LEVEL_PGTABLES |
44 | 44 | ||
45 | static inline void pmd_free(pmd_t *pmd) | 45 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
46 | { | 46 | { |
47 | free_page((unsigned long)pmd); | 47 | free_page((unsigned long)pmd); |
48 | } | 48 | } |
diff --git a/include/asm-x86/pgalloc_32.h b/include/asm-x86/pgalloc_32.h index 6c21ef951dab..bab12718a913 100644 --- a/include/asm-x86/pgalloc_32.h +++ b/include/asm-x86/pgalloc_32.h | |||
@@ -36,17 +36,17 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *p | |||
36 | * Allocate and free page tables. | 36 | * Allocate and free page tables. |
37 | */ | 37 | */ |
38 | extern pgd_t *pgd_alloc(struct mm_struct *); | 38 | extern pgd_t *pgd_alloc(struct mm_struct *); |
39 | extern void pgd_free(pgd_t *pgd); | 39 | extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); |
40 | 40 | ||
41 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); | 41 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); |
42 | extern struct page *pte_alloc_one(struct mm_struct *, unsigned long); | 42 | extern struct page *pte_alloc_one(struct mm_struct *, unsigned long); |
43 | 43 | ||
44 | static inline void pte_free_kernel(pte_t *pte) | 44 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
45 | { | 45 | { |
46 | free_page((unsigned long)pte); | 46 | free_page((unsigned long)pte); |
47 | } | 47 | } |
48 | 48 | ||
49 | static inline void pte_free(struct page *pte) | 49 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
50 | { | 50 | { |
51 | __free_page(pte); | 51 | __free_page(pte); |
52 | } | 52 | } |
@@ -63,7 +63,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
63 | return (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); | 63 | return (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); |
64 | } | 64 | } |
65 | 65 | ||
66 | static inline void pmd_free(pmd_t *pmd) | 66 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
67 | { | 67 | { |
68 | BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); | 68 | BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); |
69 | free_page((unsigned long)pmd); | 69 | free_page((unsigned long)pmd); |
diff --git a/include/asm-x86/pgalloc_64.h b/include/asm-x86/pgalloc_64.h index 8bb564687860..315314ce4bfb 100644 --- a/include/asm-x86/pgalloc_64.h +++ b/include/asm-x86/pgalloc_64.h | |||
@@ -17,7 +17,7 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *p | |||
17 | set_pmd(pmd, __pmd(_PAGE_TABLE | (page_to_pfn(pte) << PAGE_SHIFT))); | 17 | set_pmd(pmd, __pmd(_PAGE_TABLE | (page_to_pfn(pte) << PAGE_SHIFT))); |
18 | } | 18 | } |
19 | 19 | ||
20 | static inline void pmd_free(pmd_t *pmd) | 20 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
21 | { | 21 | { |
22 | BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); | 22 | BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); |
23 | free_page((unsigned long)pmd); | 23 | free_page((unsigned long)pmd); |
@@ -33,7 +33,7 @@ static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
33 | return (pud_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); | 33 | return (pud_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); |
34 | } | 34 | } |
35 | 35 | ||
36 | static inline void pud_free (pud_t *pud) | 36 | static inline void pud_free(struct mm_struct *mm, pud_t *pud) |
37 | { | 37 | { |
38 | BUG_ON((unsigned long)pud & (PAGE_SIZE-1)); | 38 | BUG_ON((unsigned long)pud & (PAGE_SIZE-1)); |
39 | free_page((unsigned long)pud); | 39 | free_page((unsigned long)pud); |
@@ -77,7 +77,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
77 | return pgd; | 77 | return pgd; |
78 | } | 78 | } |
79 | 79 | ||
80 | static inline void pgd_free(pgd_t *pgd) | 80 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
81 | { | 81 | { |
82 | BUG_ON((unsigned long)pgd & (PAGE_SIZE-1)); | 82 | BUG_ON((unsigned long)pgd & (PAGE_SIZE-1)); |
83 | pgd_list_del(pgd); | 83 | pgd_list_del(pgd); |
@@ -100,13 +100,13 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long add | |||
100 | /* Should really implement gc for free page table pages. This could be | 100 | /* Should really implement gc for free page table pages. This could be |
101 | done with a reference count in struct page. */ | 101 | done with a reference count in struct page. */ |
102 | 102 | ||
103 | static inline void pte_free_kernel(pte_t *pte) | 103 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
104 | { | 104 | { |
105 | BUG_ON((unsigned long)pte & (PAGE_SIZE-1)); | 105 | BUG_ON((unsigned long)pte & (PAGE_SIZE-1)); |
106 | free_page((unsigned long)pte); | 106 | free_page((unsigned long)pte); |
107 | } | 107 | } |
108 | 108 | ||
109 | static inline void pte_free(struct page *pte) | 109 | static inline void pte_free(struct mm_struct *mm, struct page *pte) |
110 | { | 110 | { |
111 | __free_page(pte); | 111 | __free_page(pte); |
112 | } | 112 | } |
diff --git a/include/asm-xtensa/pgalloc.h b/include/asm-xtensa/pgalloc.h index 3e5b56525102..1d51ba5463f9 100644 --- a/include/asm-xtensa/pgalloc.h +++ b/include/asm-xtensa/pgalloc.h | |||
@@ -31,7 +31,7 @@ pgd_alloc(struct mm_struct *mm) | |||
31 | return (pgd_t*) __get_free_pages(GFP_KERNEL | __GFP_ZERO, PGD_ORDER); | 31 | return (pgd_t*) __get_free_pages(GFP_KERNEL | __GFP_ZERO, PGD_ORDER); |
32 | } | 32 | } |
33 | 33 | ||
34 | static inline void pgd_free(pgd_t *pgd) | 34 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
35 | { | 35 | { |
36 | free_page((unsigned long)pgd); | 36 | free_page((unsigned long)pgd); |
37 | } | 37 | } |
@@ -52,12 +52,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, | |||
52 | return virt_to_page(pte_alloc_one_kernel(mm, addr)); | 52 | return virt_to_page(pte_alloc_one_kernel(mm, addr)); |
53 | } | 53 | } |
54 | 54 | ||
55 | static inline void pte_free_kernel(pte_t *pte) | 55 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
56 | { | 56 | { |
57 | kmem_cache_free(pgtable_cache, pte); | 57 | kmem_cache_free(pgtable_cache, pte); |
58 | } | 58 | } |
59 | 59 | ||
60 | static inline void pte_free(struct page *page) | 60 | static inline void pte_free(struct mm_struct *mm, struct page *page) |
61 | { | 61 | { |
62 | kmem_cache_free(pgtable_cache, page_address(page)); | 62 | kmem_cache_free(pgtable_cache, page_address(page)); |
63 | } | 63 | } |
diff --git a/include/asm-xtensa/tlb.h b/include/asm-xtensa/tlb.h index 4830232017af..31c220faca02 100644 --- a/include/asm-xtensa/tlb.h +++ b/include/asm-xtensa/tlb.h | |||
@@ -42,6 +42,6 @@ | |||
42 | 42 | ||
43 | #include <asm-generic/tlb.h> | 43 | #include <asm-generic/tlb.h> |
44 | 44 | ||
45 | #define __pte_free_tlb(tlb,pte) pte_free(pte) | 45 | #define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte) |
46 | 46 | ||
47 | #endif /* _XTENSA_TLB_H */ | 47 | #endif /* _XTENSA_TLB_H */ |
diff --git a/kernel/fork.c b/kernel/fork.c index 6caf4f23206b..1160f87ba700 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -325,7 +325,7 @@ static inline int mm_alloc_pgd(struct mm_struct * mm) | |||
325 | 325 | ||
326 | static inline void mm_free_pgd(struct mm_struct * mm) | 326 | static inline void mm_free_pgd(struct mm_struct * mm) |
327 | { | 327 | { |
328 | pgd_free(mm->pgd); | 328 | pgd_free(mm, mm->pgd); |
329 | } | 329 | } |
330 | #else | 330 | #else |
331 | #define dup_mmap(mm, oldmm) (0) | 331 | #define dup_mmap(mm, oldmm) (0) |
diff --git a/mm/memory.c b/mm/memory.c index b7cb2e01705f..1c81fc2174cd 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -305,7 +305,7 @@ int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address) | |||
305 | spin_lock(&mm->page_table_lock); | 305 | spin_lock(&mm->page_table_lock); |
306 | if (pmd_present(*pmd)) { /* Another has populated it */ | 306 | if (pmd_present(*pmd)) { /* Another has populated it */ |
307 | pte_lock_deinit(new); | 307 | pte_lock_deinit(new); |
308 | pte_free(new); | 308 | pte_free(mm, new); |
309 | } else { | 309 | } else { |
310 | mm->nr_ptes++; | 310 | mm->nr_ptes++; |
311 | inc_zone_page_state(new, NR_PAGETABLE); | 311 | inc_zone_page_state(new, NR_PAGETABLE); |
@@ -323,7 +323,7 @@ int __pte_alloc_kernel(pmd_t *pmd, unsigned long address) | |||
323 | 323 | ||
324 | spin_lock(&init_mm.page_table_lock); | 324 | spin_lock(&init_mm.page_table_lock); |
325 | if (pmd_present(*pmd)) /* Another has populated it */ | 325 | if (pmd_present(*pmd)) /* Another has populated it */ |
326 | pte_free_kernel(new); | 326 | pte_free_kernel(&init_mm, new); |
327 | else | 327 | else |
328 | pmd_populate_kernel(&init_mm, pmd, new); | 328 | pmd_populate_kernel(&init_mm, pmd, new); |
329 | spin_unlock(&init_mm.page_table_lock); | 329 | spin_unlock(&init_mm.page_table_lock); |
@@ -2501,7 +2501,7 @@ int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address) | |||
2501 | 2501 | ||
2502 | spin_lock(&mm->page_table_lock); | 2502 | spin_lock(&mm->page_table_lock); |
2503 | if (pgd_present(*pgd)) /* Another has populated it */ | 2503 | if (pgd_present(*pgd)) /* Another has populated it */ |
2504 | pud_free(new); | 2504 | pud_free(mm, new); |
2505 | else | 2505 | else |
2506 | pgd_populate(mm, pgd, new); | 2506 | pgd_populate(mm, pgd, new); |
2507 | spin_unlock(&mm->page_table_lock); | 2507 | spin_unlock(&mm->page_table_lock); |
@@ -2523,12 +2523,12 @@ int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address) | |||
2523 | spin_lock(&mm->page_table_lock); | 2523 | spin_lock(&mm->page_table_lock); |
2524 | #ifndef __ARCH_HAS_4LEVEL_HACK | 2524 | #ifndef __ARCH_HAS_4LEVEL_HACK |
2525 | if (pud_present(*pud)) /* Another has populated it */ | 2525 | if (pud_present(*pud)) /* Another has populated it */ |
2526 | pmd_free(new); | 2526 | pmd_free(mm, new); |
2527 | else | 2527 | else |
2528 | pud_populate(mm, pud, new); | 2528 | pud_populate(mm, pud, new); |
2529 | #else | 2529 | #else |
2530 | if (pgd_present(*pud)) /* Another has populated it */ | 2530 | if (pgd_present(*pud)) /* Another has populated it */ |
2531 | pmd_free(new); | 2531 | pmd_free(mm, new); |
2532 | else | 2532 | else |
2533 | pgd_populate(mm, pud, new); | 2533 | pgd_populate(mm, pud, new); |
2534 | #endif /* __ARCH_HAS_4LEVEL_HACK */ | 2534 | #endif /* __ARCH_HAS_4LEVEL_HACK */ |