Skip to content

Commit 1322479

Browse files
npiggintorvalds
authored andcommitted
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>
1 parent 7b167b6 commit 1322479

39 files changed

Lines changed: 25 additions & 395 deletions

File tree

‎arch/alpha/include/asm/pgalloc.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,4 @@ pmd_free(struct mm_struct *mm, pmd_t *pmd)
5353
free_page((unsigned long)pmd);
5454
}
5555

56-
#define check_pgt_cache() do { } while (0)
57-
5856
#endif /* _ALPHA_PGALLOC_H */

‎arch/arc/include/asm/pgalloc.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t ptep)
129129

130130
#define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, pte)
131131

132-
#define check_pgt_cache() do { } while (0)
133132
#define pmd_pgtable(pmd) ((pgtable_t) pmd_page_vaddr(pmd))
134133

135134
#endif /* _ASM_ARC_PGALLOC_H */

‎arch/arm/include/asm/pgalloc.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#include <asm/cacheflush.h>
1616
#include <asm/tlbflush.h>
1717

18-
#define check_pgt_cache() do { } while (0)
19-
2018
#ifdef CONFIG_MMU
2119

2220
#define _PAGE_USER_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_USER))

‎arch/arm64/include/asm/pgalloc.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
#include <asm-generic/pgalloc.h> /* for pte_{alloc,free}_one */
1717

18-
#define check_pgt_cache() do { } while (0)
19-
2018
#define PGD_SIZE (PTRS_PER_PGD * sizeof(pgd_t))
2119

2220
#if CONFIG_PGTABLE_LEVELS > 2

‎arch/csky/include/asm/pgalloc.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ do { \
7575
tlb_remove_page(tlb, pte); \
7676
} while (0)
7777

78-
#define check_pgt_cache() do {} while (0)
79-
8078
extern void pagetable_init(void);
8179
extern void pre_mmu_init(void);
8280
extern void pre_trap_init(void);

‎arch/hexagon/include/asm/pgalloc.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
#include <asm-generic/pgalloc.h> /* for pte_{alloc,free}_one */
1515

16-
#define check_pgt_cache() do {} while (0)
17-
1816
extern unsigned long long kmap_generation;
1917

2018
/*

‎arch/ia64/Kconfig‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ config 64BIT
7272
config ZONE_DMA32
7373
def_bool y
7474

75-
config QUICKLIST
76-
bool
77-
default y
78-
7975
config MMU
8076
bool
8177
default y

‎arch/ia64/include/asm/pgalloc.h‎

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,17 @@
1919
#include <linux/mm.h>
2020
#include <linux/page-flags.h>
2121
#include <linux/threads.h>
22-
#include <linux/quicklist.h>
2322

2423
#include <asm/mmu_context.h>
2524

2625
static inline pgd_t *pgd_alloc(struct mm_struct *mm)
2726
{
28-
return quicklist_alloc(0, GFP_KERNEL, NULL);
27+
return (pgd_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
2928
}
3029

3130
static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
3231
{
33-
quicklist_free(0, NULL, pgd);
32+
free_page((unsigned long)pgd);
3433
}
3534

3635
#if CONFIG_PGTABLE_LEVELS == 4
@@ -42,12 +41,12 @@ pgd_populate(struct mm_struct *mm, pgd_t * pgd_entry, pud_t * pud)
4241

4342
static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
4443
{
45-
return quicklist_alloc(0, GFP_KERNEL, NULL);
44+
return (pud_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
4645
}
4746

4847
static inline void pud_free(struct mm_struct *mm, pud_t *pud)
4948
{
50-
quicklist_free(0, NULL, pud);
49+
free_page((unsigned long)pud);
5150
}
5251
#define __pud_free_tlb(tlb, pud, address) pud_free((tlb)->mm, pud)
5352
#endif /* CONFIG_PGTABLE_LEVELS == 4 */
@@ -60,12 +59,12 @@ pud_populate(struct mm_struct *mm, pud_t * pud_entry, pmd_t * pmd)
6059

6160
static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
6261
{
63-
return quicklist_alloc(0, GFP_KERNEL, NULL);
62+
return (pmd_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
6463
}
6564

6665
static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
6766
{
68-
quicklist_free(0, NULL, pmd);
67+
free_page((unsigned long)pmd);
6968
}
7069

7170
#define __pmd_free_tlb(tlb, pmd, address) pmd_free((tlb)->mm, pmd)
@@ -86,38 +85,31 @@ pmd_populate_kernel(struct mm_struct *mm, pmd_t * pmd_entry, pte_t * pte)
8685
static inline pgtable_t pte_alloc_one(struct mm_struct *mm)
8786
{
8887
struct page *page;
89-
void *pg;
9088

91-
pg = quicklist_alloc(0, GFP_KERNEL, NULL);
92-
if (!pg)
89+
page = alloc_page(GFP_KERNEL | __GFP_ZERO);
90+
if (!page)
9391
return NULL;
94-
page = virt_to_page(pg);
9592
if (!pgtable_page_ctor(page)) {
96-
quicklist_free(0, NULL, pg);
93+
__free_page(page);
9794
return NULL;
9895
}
9996
return page;
10097
}
10198

10299
static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
103100
{
104-
return quicklist_alloc(0, GFP_KERNEL, NULL);
101+
return (pte_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
105102
}
106103

107104
static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
108105
{
109106
pgtable_page_dtor(pte);
110-
quicklist_free_page(0, NULL, pte);
107+
__free_page(pte);
111108
}
112109

113110
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
114111
{
115-
quicklist_free(0, NULL, pte);
116-
}
117-
118-
static inline void check_pgt_cache(void)
119-
{
120-
quicklist_trim(0, NULL, 25, 16);
112+
free_page((unsigned long)pte);
121113
}
122114

123115
#define __pte_free_tlb(tlb, pte, address) pte_free((tlb)->mm, pte)

‎arch/m68k/include/asm/pgtable_mm.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,4 @@ pgprot_t pgprot_dmacoherent(pgprot_t prot);
181181
*/
182182
#define pgtable_cache_init() do { } while (0)
183183

184-
#define check_pgt_cache() do { } while (0)
185-
186184
#endif /* _M68K_PGTABLE_H */

‎arch/m68k/include/asm/pgtable_no.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,4 @@ extern void paging_init(void);
6060

6161
#include <asm-generic/pgtable.h>
6262

63-
#define check_pgt_cache() do { } while (0)
64-
6563
#endif /* _M68KNOMMU_PGTABLE_H */

0 commit comments

Comments
 (0)