aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2016-04-29 09:26:17 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2016-05-11 07:53:50 -0400
commit74701d5947a6fb38ece37c1ff1e5a77c36ee7b9c (patch)
tree12c888032f9384580e7552f12800ce8f349ade3e
parentbcbe7f777eb396f9bbf4cb1cab3b206f50881191 (diff)
powerpc/mm: Rename function to indicate we are allocating fragments
Only code cleanup. No functionality change. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/include/asm/book3s/64/pgalloc.h12
-rw-r--r--arch/powerpc/include/asm/nohash/64/pgalloc.h12
-rw-r--r--arch/powerpc/mm/pgtable_64.c21
3 files changed, 16 insertions, 29 deletions
diff --git a/arch/powerpc/include/asm/book3s/64/pgalloc.h b/arch/powerpc/include/asm/book3s/64/pgalloc.h
index 2a246245eca0..37283e3d8e56 100644
--- a/arch/powerpc/include/asm/book3s/64/pgalloc.h
+++ b/arch/powerpc/include/asm/book3s/64/pgalloc.h
@@ -174,8 +174,8 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table,
174 174
175#else /* if CONFIG_PPC_64K_PAGES */ 175#else /* if CONFIG_PPC_64K_PAGES */
176 176
177extern pte_t *page_table_alloc(struct mm_struct *, unsigned long, int); 177extern pte_t *pte_fragment_alloc(struct mm_struct *, unsigned long, int);
178extern void page_table_free(struct mm_struct *, unsigned long *, int); 178extern void pte_fragment_free(unsigned long *, int);
179extern void pgtable_free_tlb(struct mmu_gather *tlb, void *table, int shift); 179extern void pgtable_free_tlb(struct mmu_gather *tlb, void *table, int shift);
180#ifdef CONFIG_SMP 180#ifdef CONFIG_SMP
181extern void __tlb_remove_table(void *_table); 181extern void __tlb_remove_table(void *_table);
@@ -195,23 +195,23 @@ static inline pgtable_t pmd_pgtable(pmd_t pmd)
195static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, 195static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
196 unsigned long address) 196 unsigned long address)
197{ 197{
198 return (pte_t *)page_table_alloc(mm, address, 1); 198 return (pte_t *)pte_fragment_alloc(mm, address, 1);
199} 199}
200 200
201static inline pgtable_t pte_alloc_one(struct mm_struct *mm, 201static inline pgtable_t pte_alloc_one(struct mm_struct *mm,
202 unsigned long address) 202 unsigned long address)
203{ 203{
204 return (pgtable_t)page_table_alloc(mm, address, 0); 204 return (pgtable_t)pte_fragment_alloc(mm, address, 0);
205} 205}
206 206
207static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) 207static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
208{ 208{
209 page_table_free(mm, (unsigned long *)pte, 1); 209 pte_fragment_free((unsigned long *)pte, 1);
210} 210}
211 211
212static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage) 212static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage)
213{ 213{
214 page_table_free(mm, (unsigned long *)ptepage, 0); 214 pte_fragment_free((unsigned long *)ptepage, 0);
215} 215}
216 216
217static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, 217static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table,
diff --git a/arch/powerpc/include/asm/nohash/64/pgalloc.h b/arch/powerpc/include/asm/nohash/64/pgalloc.h
index 69ef28a81733..be0cce7f7d4e 100644
--- a/arch/powerpc/include/asm/nohash/64/pgalloc.h
+++ b/arch/powerpc/include/asm/nohash/64/pgalloc.h
@@ -164,8 +164,8 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table,
164 164
165#else /* if CONFIG_PPC_64K_PAGES */ 165#else /* if CONFIG_PPC_64K_PAGES */
166 166
167extern pte_t *page_table_alloc(struct mm_struct *, unsigned long, int); 167extern pte_t *pte_fragment_alloc(struct mm_struct *, unsigned long, int);
168extern void page_table_free(struct mm_struct *, unsigned long *, int); 168extern void pte_fragment_free(unsigned long *, int);
169extern void pgtable_free_tlb(struct mmu_gather *tlb, void *table, int shift); 169extern void pgtable_free_tlb(struct mmu_gather *tlb, void *table, int shift);
170#ifdef CONFIG_SMP 170#ifdef CONFIG_SMP
171extern void __tlb_remove_table(void *_table); 171extern void __tlb_remove_table(void *_table);
@@ -193,23 +193,23 @@ static inline pgtable_t pmd_pgtable(pmd_t pmd)
193static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, 193static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
194 unsigned long address) 194 unsigned long address)
195{ 195{
196 return (pte_t *)page_table_alloc(mm, address, 1); 196 return (pte_t *)pte_fragment_alloc(mm, address, 1);
197} 197}
198 198
199static inline pgtable_t pte_alloc_one(struct mm_struct *mm, 199static inline pgtable_t pte_alloc_one(struct mm_struct *mm,
200 unsigned long address) 200 unsigned long address)
201{ 201{
202 return (pgtable_t)page_table_alloc(mm, address, 0); 202 return (pgtable_t)pte_fragment_alloc(mm, address, 0);
203} 203}
204 204
205static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) 205static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
206{ 206{
207 page_table_free(mm, (unsigned long *)pte, 1); 207 pte_fragment_fre((unsigned long *)pte, 1);
208} 208}
209 209
210static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage) 210static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage)
211{ 211{
212 page_table_free(mm, (unsigned long *)ptepage, 0); 212 pte_fragment_free((unsigned long *)ptepage, 0);
213} 213}
214 214
215static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, 215static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table,
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index dafcd9ff78df..a9a2238c5565 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -357,7 +357,7 @@ static pte_t *__alloc_for_cache(struct mm_struct *mm, int kernel)
357 return (pte_t *)ret; 357 return (pte_t *)ret;
358} 358}
359 359
360pte_t *page_table_alloc(struct mm_struct *mm, unsigned long vmaddr, int kernel) 360pte_t *pte_fragment_alloc(struct mm_struct *mm, unsigned long vmaddr, int kernel)
361{ 361{
362 pte_t *pte; 362 pte_t *pte;
363 363
@@ -368,7 +368,7 @@ pte_t *page_table_alloc(struct mm_struct *mm, unsigned long vmaddr, int kernel)
368 return __alloc_for_cache(mm, kernel); 368 return __alloc_for_cache(mm, kernel);
369} 369}
370 370
371void page_table_free(struct mm_struct *mm, unsigned long *table, int kernel) 371void pte_fragment_free(unsigned long *table, int kernel)
372{ 372{
373 struct page *page = virt_to_page(table); 373 struct page *page = virt_to_page(table);
374 if (put_page_testzero(page)) { 374 if (put_page_testzero(page)) {
@@ -379,15 +379,6 @@ void page_table_free(struct mm_struct *mm, unsigned long *table, int kernel)
379} 379}
380 380
381#ifdef CONFIG_SMP 381#ifdef CONFIG_SMP
382static void page_table_free_rcu(void *table)
383{
384 struct page *page = virt_to_page(table);
385 if (put_page_testzero(page)) {
386 pgtable_page_dtor(page);
387 free_hot_cold_page(page, 0);
388 }
389}
390
391void pgtable_free_tlb(struct mmu_gather *tlb, void *table, int shift) 382void pgtable_free_tlb(struct mmu_gather *tlb, void *table, int shift)
392{ 383{
393 unsigned long pgf = (unsigned long)table; 384 unsigned long pgf = (unsigned long)table;
@@ -404,7 +395,7 @@ void __tlb_remove_table(void *_table)
404 395
405 if (!shift) 396 if (!shift)
406 /* PTE page needs special handling */ 397 /* PTE page needs special handling */
407 page_table_free_rcu(table); 398 pte_fragment_free(table, 0);
408 else { 399 else {
409 BUG_ON(shift > MAX_PGTABLE_INDEX_SIZE); 400 BUG_ON(shift > MAX_PGTABLE_INDEX_SIZE);
410 kmem_cache_free(PGT_CACHE(shift), table); 401 kmem_cache_free(PGT_CACHE(shift), table);
@@ -415,11 +406,7 @@ void pgtable_free_tlb(struct mmu_gather *tlb, void *table, int shift)
415{ 406{
416 if (!shift) { 407 if (!shift) {
417 /* PTE page needs special handling */ 408 /* PTE page needs special handling */
418 struct page *page = virt_to_page(table); 409 pte_fragment_free(table, 0);
419 if (put_page_testzero(page)) {
420 pgtable_page_dtor(page);
421 free_hot_cold_page(page, 0);
422 }
423 } else { 410 } else {
424 BUG_ON(shift > MAX_PGTABLE_INDEX_SIZE); 411 BUG_ON(shift > MAX_PGTABLE_INDEX_SIZE);
425 kmem_cache_free(PGT_CACHE(shift), table); 412 kmem_cache_free(PGT_CACHE(shift), table);