aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2019-09-23 15:35:19 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-09-24 15:54:09 -0700
commit13224794cb0832caa403ad583d8605202cabc6bc (patch)
tree74ecb05caeea21ae665270365734752a043644b1 /arch/sh/include
parentmm: release the spinlock on zap_pte_range (diff)
downloadlinux-dev-13224794cb0832caa403ad583d8605202cabc6bc.tar.xz
linux-dev-13224794cb0832caa403ad583d8605202cabc6bc.zip
mm: remove quicklist page table caches
Patch series "mm: remove quicklist page table caches". A while ago Nicholas proposed to remove quicklist page table caches [1]. I've rebased his patch on the curren upstream and switched ia64 and sh to use generic versions of PTE allocation. [1] https://lore.kernel.org/linux-mm/20190711030339.20892-1-npiggin@gmail.com This patch (of 3): Remove page table allocator "quicklists". These have been around for a long time, but have not got much traction in the last decade and are only used on ia64 and sh architectures. The numbers in the initial commit look interesting but probably don't apply anymore. If anybody wants to resurrect this it's in the git history, but it's unhelpful to have this code and divergent allocator behaviour for minor archs. Also it might be better to instead make more general improvements to page allocator if this is still so slow. Link: http://lkml.kernel.org/r/1565250728-21721-2-git-send-email-rppt@linux.ibm.com Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Mike Rapoport <rppt@linux.ibm.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/sh/include')
-rw-r--r--arch/sh/include/asm/pgalloc.h22
1 files changed, 6 insertions, 16 deletions
diff --git a/arch/sh/include/asm/pgalloc.h b/arch/sh/include/asm/pgalloc.h
index b56f908b1395..9e15054858b4 100644
--- a/arch/sh/include/asm/pgalloc.h
+++ b/arch/sh/include/asm/pgalloc.h
@@ -2,11 +2,8 @@
#ifndef __ASM_SH_PGALLOC_H
#define __ASM_SH_PGALLOC_H
-#include <linux/quicklist.h>
#include <asm/page.h>
-#define QUICK_PT 0 /* Other page table pages that are zero on free */
-
extern pgd_t *pgd_alloc(struct mm_struct *);
extern void pgd_free(struct mm_struct *mm, pgd_t *pgd);
@@ -34,20 +31,18 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
*/
static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
{
- return quicklist_alloc(QUICK_PT, GFP_KERNEL, NULL);
+ return (pte_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
}
static inline pgtable_t pte_alloc_one(struct mm_struct *mm)
{
struct page *page;
- void *pg;
- pg = quicklist_alloc(QUICK_PT, GFP_KERNEL, NULL);
- if (!pg)
+ page = alloc_page(GFP_KERNEL | __GFP_ZERO);
+ if (!page)
return NULL;
- page = virt_to_page(pg);
if (!pgtable_page_ctor(page)) {
- quicklist_free(QUICK_PT, NULL, pg);
+ __free_page(page);
return NULL;
}
return page;
@@ -55,13 +50,13 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm)
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
- quicklist_free(QUICK_PT, NULL, pte);
+ free_page((unsigned long)pte);
}
static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
{
pgtable_page_dtor(pte);
- quicklist_free_page(QUICK_PT, NULL, pte);
+ __free_page(pte);
}
#define __pte_free_tlb(tlb,pte,addr) \
@@ -79,9 +74,4 @@ do { \
} while (0);
#endif
-static inline void check_pgt_cache(void)
-{
- quicklist_trim(QUICK_PT, NULL, 25, 16);
-}
-
#endif /* __ASM_SH_PGALLOC_H */