mm: remove quicklist page table caches
Subsystems (29)
cover mm: remove quicklist page table caches
Hi,
I 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/[email protected]
Mike Rapoport (2):
ia64: switch to generic version of pte allocation
sh: switch to generic version of pte allocation
Nicholas Piggin (1):
mm: remove quicklist page table caches
arch/alpha/include/asm/pgalloc.h | 2 - arch/arc/include/asm/pgalloc.h | 1 - arch/arm/include/asm/pgalloc.h | 2 - arch/arm64/include/asm/pgalloc.h | 2 - arch/csky/include/asm/pgalloc.h | 2 - arch/hexagon/include/asm/pgalloc.h | 2 - arch/ia64/Kconfig | 4 -- arch/ia64/include/asm/pgalloc.h | 52 +++-------------- arch/m68k/include/asm/pgtable_mm.h | 2 - arch/m68k/include/asm/pgtable_no.h | 2 - arch/microblaze/include/asm/pgalloc.h | 89 +++-------------------------- arch/microblaze/mm/pgtable.c | 4 -- arch/mips/include/asm/pgalloc.h | 2 - arch/nds32/include/asm/pgalloc.h | 2 - arch/nios2/include/asm/pgalloc.h | 2 - arch/openrisc/include/asm/pgalloc.h | 2 - arch/parisc/include/asm/pgalloc.h | 2 - arch/powerpc/include/asm/pgalloc.h | 2 - arch/riscv/include/asm/pgalloc.h | 4 -- arch/s390/include/asm/pgtable.h | 1 - arch/sh/include/asm/pgalloc.h | 44 +-------------- arch/sh/mm/Kconfig | 3 - arch/sparc/include/asm/pgalloc_32.h | 2 - arch/sparc/include/asm/pgalloc_64.h | 2 - arch/sparc/mm/init_32.c | 1 - arch/um/include/asm/pgalloc.h | 2 - arch/unicore32/include/asm/pgalloc.h | 2 - arch/x86/include/asm/pgtable_32.h | 1 - arch/x86/include/asm/pgtable_64.h | 1 - arch/xtensa/include/asm/tlbflush.h | 3 - fs/proc/meminfo.c | 4 -- include/asm-generic/pgalloc.h | 5 -- include/linux/quicklist.h | 94 ------------------------------- kernel/sched/idle.c | 1 - lib/show_mem.c | 5 -- mm/Kconfig | 5 -- mm/Makefile | 1 - mm/mmu_gather.c | 2 - mm/quicklist.c | 103 ---------------------------------- 39 files changed, 16 insertions(+), 446 deletions(-) delete mode 100644 include/linux/quicklist.h delete mode 100644 mm/quicklist.c
Signature · 1 line
2.7.4
PATCH 1/3 mm: remove quicklist page table caches
From: Nicholas Piggin <[email protected]>
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.
--- arch/alpha/include/asm/pgalloc.h | 2 - arch/arc/include/asm/pgalloc.h | 1 - arch/arm/include/asm/pgalloc.h | 2 - arch/arm64/include/asm/pgalloc.h | 2 - arch/csky/include/asm/pgalloc.h | 2 - arch/hexagon/include/asm/pgalloc.h | 2 - arch/ia64/Kconfig | 4 -- arch/ia64/include/asm/pgalloc.h | 32 ++++------- arch/m68k/include/asm/pgtable_mm.h | 2 - arch/m68k/include/asm/pgtable_no.h | 2 - arch/microblaze/include/asm/pgalloc.h | 89 +++-------------------------- arch/microblaze/mm/pgtable.c | 4 -- arch/mips/include/asm/pgalloc.h | 2 - arch/nds32/include/asm/pgalloc.h | 2 - arch/nios2/include/asm/pgalloc.h | 2 - arch/openrisc/include/asm/pgalloc.h | 2 - arch/parisc/include/asm/pgalloc.h | 2 - arch/powerpc/include/asm/pgalloc.h | 2 - arch/riscv/include/asm/pgalloc.h | 4 -- arch/s390/include/asm/pgtable.h | 1 - arch/sh/include/asm/pgalloc.h | 22 ++------ arch/sh/mm/Kconfig | 3 - arch/sparc/include/asm/pgalloc_32.h | 2 - arch/sparc/include/asm/pgalloc_64.h | 2 - arch/sparc/mm/init_32.c | 1 - arch/um/include/asm/pgalloc.h | 2 - arch/unicore32/include/asm/pgalloc.h | 2 - arch/x86/include/asm/pgtable_32.h | 1 - arch/x86/include/asm/pgtable_64.h | 1 - arch/xtensa/include/asm/tlbflush.h | 3 - fs/proc/meminfo.c | 4 -- include/asm-generic/pgalloc.h | 5 -- include/linux/quicklist.h | 94 ------------------------------- kernel/sched/idle.c | 1 - lib/show_mem.c | 5 -- mm/Kconfig | 5 -- mm/Makefile | 1 - mm/mmu_gather.c | 2 - mm/quicklist.c | 103 ---------------------------------- 39 files changed, 25 insertions(+), 395 deletions(-) delete mode 100644 include/linux/quicklist.h delete mode 100644 mm/quicklist.c
arch/alpha/include/asm/pgalloc.h +0 -2
@@ -53,6 +53,4 @@ pmd_free(struct mm_struct *mm, pmd_t *pmd) free_page((unsigned long)pmd); } -#define check_pgt_cache () do { } while (0) -#endif /* _ALPHA_PGALLOC_H */
arch/arc/include/asm/pgalloc.h +0 -1
@@ -129,7 +129,6 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t ptep)#define __pte_free_tlb (tlb, pte, addr) pte_free((tlb)->mm, pte) -#define check_pgt_cache () do { } while (0)#define pmd_pgtable (pmd) ((pgtable_t) pmd_page_vaddr(pmd))#endif /* _ASM_ARC_PGALLOC_H */
arch/arm/include/asm/pgalloc.h +0 -2
@@ -15,8 +15,6 @@#include <asm/cacheflush.h> #include <asm/tlbflush.h> -#define check_pgt_cache () do { } while (0) -#ifdef CONFIG_MMU #define _PAGE_USER_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_USER))
arch/arm64/include/asm/pgalloc.h +0 -2
@@ -15,8 +15,6 @@#include <asm-generic/pgalloc.h> /* for pte_{alloc,free}_one */ -#define check_pgt_cache () do { } while (0) -#define PGD_SIZE (PTRS_PER_PGD * sizeof(pgd_t))#if CONFIG_PGTABLE_LEVELS >2
arch/csky/include/asm/pgalloc.h +0 -2
@@ -75,8 +75,6 @@ do { \tlb_remove_page (tlb, pte); \ }while (0 ) -#define check_pgt_cache () do {} while (0) - extern void pagetable_init(void);extern void pre_mmu_init (void );extern void pre_trap_init (void );
arch/hexagon/include/asm/pgalloc.h +0 -2
@@ -13,8 +13,6 @@#include <asm-generic/pgalloc.h> /* for pte_{alloc,free}_one */ -#define check_pgt_cache () do {} while (0) -extern unsigned long long kmap_generation;/*
arch/ia64/Kconfig +0 -4
@@ -68,10 +68,6 @@ config ZONE_DMA32 def_bool y depends on !IA64_SGI_SN2 -config QUICKLIST - bool - default y - config MMU bool default y
arch/ia64/include/asm/pgalloc.h +12 -20
@@ -19,18 +19,17 @@#include <linux/mm.h> #include <linux/page-flags.h> #include <linux/threads.h> -#include <linux/quicklist.h> #include <asm/mmu_context.h> static inline pgd_t *pgd_alloc (struct mm_struct *mm) { -return quicklist_alloc (0 ,GFP_KERNEL ,NULL ); +return (pgd_t *)__get_free_page (GFP_KERNEL | __GFP_ZERO); }static inline void pgd_free (struct mm_struct *mm,pgd_t *pgd) { -quicklist_free (0 ,NULL , pgd); +free_page ((unsigned long )pgd); }#if CONFIG_PGTABLE_LEVELS ==4
@@ -42,12 +41,12 @@ pgd_populate(struct mm_struct *mm, pgd_t * pgd_entry, pud_t * pud)static inline pud_t *pud_alloc_one (struct mm_struct *mm,unsigned long addr) { -return quicklist_alloc (0 ,GFP_KERNEL ,NULL ); +return (pud_t *)__get_free_page (GFP_KERNEL | __GFP_ZERO); }static inline void pud_free (struct mm_struct *mm,pud_t *pud) { -quicklist_free (0 ,NULL , pud); +free_page ((unsigned long )pud); }#define __pud_free_tlb (tlb, pud, address) pud_free((tlb)->mm, pud)#endif /* CONFIG_PGTABLE_LEVELS == 4 */
@@ -60,12 +59,12 @@ pud_populate(struct mm_struct *mm, pud_t * pud_entry, pmd_t * pmd)static inline pmd_t *pmd_alloc_one (struct mm_struct *mm,unsigned long addr) { -return quicklist_alloc (0 ,GFP_KERNEL ,NULL ); +return (pmd_t *)__get_free_page (GFP_KERNEL | __GFP_ZERO); }static inline void pmd_free (struct mm_struct *mm,pmd_t *pmd) { -quicklist_free (0 ,NULL , pmd); +free_page ((unsigned long )pmd); }#define __pmd_free_tlb (tlb, pmd, address) pmd_free((tlb)->mm, pmd)
@@ -86,14 +85,12 @@ pmd_populate_kernel(struct mm_struct *mm, pmd_t * pmd_entry, pte_t * pte)static inline pgtable_t pte_alloc_one (struct mm_struct *mm) {struct page *page; -void *pg; - pg =quicklist_alloc (0 ,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 (0 ,NULL , pg); +__free_page (page);return NULL ; }return page;
@@ -101,23 +98,18 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm)static inline pte_t *pte_alloc_one_kernel (struct mm_struct *mm) { -return quicklist_alloc (0 ,GFP_KERNEL ,NULL ); +return (pte_t *)__get_free_page (GFP_KERNEL | __GFP_ZERO); }static inline void pte_free (struct mm_struct *mm,pgtable_t pte) {pgtable_page_dtor (pte); -quicklist_free_page (0 ,NULL , pte); +__free_page (pte); }static inline void pte_free_kernel (struct mm_struct *mm,pte_t *pte) { -quicklist_free (0 ,NULL , pte); -} - -static inline void check_pgt_cache (void ) -{ -quicklist_trim (0 ,NULL ,25 ,16 ); +free_page ((unsigned long )pte); }#define __pte_free_tlb (tlb, pte, address) pte_free((tlb)->mm, pte)
arch/m68k/include/asm/pgtable_mm.h +0 -2
@@ -178,6 +178,4 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,*/ #define pgtable_cache_init () do { } while (0) -#define check_pgt_cache () do { } while (0) -#endif /* _M68K_PGTABLE_H */
arch/m68k/include/asm/pgtable_no.h +0 -2
@@ -60,6 +60,4 @@ extern void paging_init(void);#include <asm-generic/pgtable.h> -#define check_pgt_cache () do { } while (0) -#endif /* _M68KNOMMU_PGTABLE_H */
arch/microblaze/include/asm/pgalloc.h +7 -82
128 lines not on this page · raw message
arch/microblaze/mm/pgtable.c +0 -4
@@ -44,10 +44,6 @@ unsigned long ioremap_base;unsigned long ioremap_bot;EXPORT_SYMBOL (ioremap_bot); -#ifndef CONFIG_SMP -struct pgtable_cache_struct quicklists; -#endif -static void __iomem *__ioremap (phys_addr_t addr,unsigned long size,unsigned long flags) {
arch/mips/include/asm/pgalloc.h +0 -2
@@ -105,8 +105,6 @@ static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud)#endif /* __PAGETABLE_PUD_FOLDED */ -#define check_pgt_cache () do { } while (0) -extern void pagetable_init (void );#endif /* _ASM_PGALLOC_H */
arch/nds32/include/asm/pgalloc.h +0 -2
@@ -23,8 +23,6 @@extern pgd_t *pgd_alloc (struct mm_struct *mm);extern void pgd_free (struct mm_struct *mm,pgd_t * pgd); -#define check_pgt_cache () do { } while (0) -static inline pgtable_t pte_alloc_one (struct mm_struct *mm) {pgtable_t pte;
arch/nios2/include/asm/pgalloc.h +0 -2
@@ -45,6 +45,4 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)tlb_remove_page ((tlb), (pte)); \ } while (0) -#define check_pgt_cache () do { } while (0) -#endif /* _ASM_NIOS2_PGALLOC_H */
arch/openrisc/include/asm/pgalloc.h +0 -2
@@ -101,6 +101,4 @@ do { \#define pmd_pgtable (pmd) pmd_page(pmd) -#define check_pgt_cache () do { } while (0) -#endif
arch/parisc/include/asm/pgalloc.h +0 -2
@@ -124,6 +124,4 @@ pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) pmd_populate_kernel(mm, pmd, page_address(pte_page))#define pmd_pgtable (pmd) pmd_page(pmd) -#define check_pgt_cache () do { } while (0) -#endif
arch/powerpc/include/asm/pgalloc.h +0 -2
@@ -64,8 +64,6 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage)extern struct kmem_cache *pgtable_cache[];#define PGT_CACHE (shift) pgtable_cache[shift] -static inline void check_pgt_cache (void ) { } -#ifdef CONFIG_PPC_BOOK3S #include <asm/book3s/pgalloc.h> #else
arch/riscv/include/asm/pgalloc.h +0 -4
@@ -82,8 +82,4 @@ do { \tlb_remove_page ((tlb), pte); \ } while (0) -static inline void check_pgt_cache(void) -{ -} -#endif /* _ASM_RISCV_PGALLOC_H */
arch/s390/include/asm/pgtable.h +0 -1
@@ -1685,7 +1685,6 @@ extern void s390_reset_cmma(struct mm_struct *mm);* No page table caches to initialise */ static inline void pgtable_cache_init (void ) { } -static inline void check_pgt_cache (void ) { }#include <asm-generic/pgtable.h>
arch/sh/include/asm/pgalloc.h +6 -16
@@ -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 */
arch/sh/mm/Kconfig +0 -3
@@ -1,9 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 menu "Memory management options" -config QUICKLIST - def_bool y - config MMU bool "Support for memory management hardware" depends on !CPU_SH2
arch/sparc/include/asm/pgalloc_32.h +0 -2
@@ -17,8 +17,6 @@ void srmmu_free_nocache(void *addr, int size);extern struct resource sparc_iomap; -#define check_pgt_cache () do { } while (0) -pgd_t *get_pgd_fast (void );static inline void free_pgd_fast (pgd_t *pgd) {
arch/sparc/include/asm/pgalloc_64.h +0 -2
@@ -69,8 +69,6 @@ void pte_free(struct mm_struct *mm, pgtable_t ptepage);#define pmd_populate (MM ,PMD ,PTE ) pmd_set(MM, PMD, PTE)#define pmd_pgtable (PMD ) ((pte_t *)__pmd_page(PMD)) -#define check_pgt_cache () do { } while (0) -void pgtable_free (void *table,bool is_page);#ifdef CONFIG_SMP
arch/sparc/mm/init_32.c +0 -1
@@ -31,7 +31,6 @@#include <asm/page.h> #include <asm/pgtable.h> #include <asm/vaddrs.h> -#include <asm/pgalloc.h> /* bug in asm-generic/tlb.h: check_pgt_cache */ #include <asm/setup.h> #include <asm/tlb.h> #include <asm/prom.h>
arch/um/include/asm/pgalloc.h +0 -2
@@ -43,7 +43,5 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)#define __pmd_free_tlb (tlb,x, address) tlb_remove_page((tlb),virt_to_page(x))#endif -#define check_pgt_cache () do { } while (0) -#endif
arch/unicore32/include/asm/pgalloc.h +0 -2
@@ -18,8 +18,6 @@#define __HAVE_ARCH_PTE_ALLOC_ONE#include <asm-generic/pgalloc.h> -#define check_pgt_cache () do { } while (0) -#define _PAGE_USER_TABLE (PMD_TYPE_TABLE | PMD_PRESENT)#define _PAGE_KERNEL_TABLE (PMD_TYPE_TABLE | PMD_PRESENT)
arch/x86/include/asm/pgtable_32.h +0 -1
@@ -30,7 +30,6 @@ extern pgd_t initial_page_table[1024];extern pmd_t initial_pg_pmd[];static inline void pgtable_cache_init (void ) { } -static inline void check_pgt_cache (void ) { }void paging_init (void );void sync_initial_page_table (void );
arch/x86/include/asm/pgtable_64.h +0 -1
@@ -242,7 +242,6 @@ extern void cleanup_highmap(void);#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN #define pgtable_cache_init () do { } while (0) -#define check_pgt_cache () do { } while (0)#define PAGE_AGP PAGE_KERNEL_NOCACHE#define HAVE_PAGE_AGP 1
arch/xtensa/include/asm/tlbflush.h +0 -3
@@ -160,9 +160,6 @@ static inline void invalidate_dtlb_mapping (unsigned address)invalidate_dtlb_entry (tlb_entry); } -#define check_pgt_cache () do { } while (0) - -/* * DO NOT USE THESE FUNCTIONS. These instructions aren't part of the Xtensa * ISA and exist only for test purposes..
fs/proc/meminfo.c +0 -4
@@ -8,7 +8,6 @@#include <linux/mmzone.h> #include <linux/proc_fs.h> #include <linux/percpu.h> -#include <linux/quicklist.h> #include <linux/seq_file.h> #include <linux/swap.h> #include <linux/vmstat.h>
@@ -106,9 +105,6 @@ static int meminfo_proc_show(struct seq_file *m, void *v) global_zone_page_state(NR_KERNEL_STACK_KB));show_val_kb (m,"PageTables: " ,global_zone_page_state (NR_PAGETABLE )); -#ifdef CONFIG_QUICKLIST -show_val_kb (m,"Quicklists: " ,quicklist_total_size ()); -#endif show_val_kb (m,"NFS_Unstable: " ,global_node_page_state (NR_UNSTABLE_NFS ));
include/asm-generic/pgalloc.h +0 -5
@@ -102,11 +102,6 @@ static inline void pte_free(struct mm_struct *mm, struct page *pte_page)__free_page (pte_page); } -#else /* CONFIG_MMU */ - -/* This is enough for a nommu architecture */ -#define check_pgt_cache () do { } while (0) -#endif /* CONFIG_MMU */ #endif /* __ASM_GENERIC_PGALLOC_H */
include/linux/quicklist.h deleted +0 -94
94 lines not on this page · raw message
kernel/sched/idle.c +0 -1
@@ -238,7 +238,6 @@ static void do_idle(void)tick_nohz_idle_enter ();while (!need_resched ()) { -check_pgt_cache ();rmb ();if (cpu_is_offline (cpu)) {
lib/show_mem.c +0 -5
@@ -6,7 +6,6 @@*/ #include <linux/mm.h> -#include <linux/quicklist.h> #include <linux/cma.h> void show_mem (unsigned int filter,nodemask_t *nodemask)
@@ -39,10 +38,6 @@ void show_mem(unsigned int filter, nodemask_t *nodemask)#ifdef CONFIG_CMA printk ("%lu pages cma reserved\n" , totalcma_pages);#endif -#ifdef CONFIG_QUICKLIST -printk ("%lu pages in pagetable cache\n" , -quicklist_total_size ()); -#endif #ifdef CONFIG_MEMORY_FAILURE printk ("%lu pages hwpoisoned\n" ,atomic_long_read (&num_poisoned_pages));#endif
mm/Kconfig +0 -5
@@ -273,11 +273,6 @@ config BOUNCE by default when ZONE_DMA or HIGHMEM is selected, but you may say n to override this. -config NR_QUICK - int - depends on QUICKLIST - default "1" - config VIRT_TO_BUS bool help
mm/Makefile +0 -1
@@ -72,7 +72,6 @@ obj-$(CONFIG_FAILSLAB) += failslab.o obj-$(CONFIG_MEMORY_HOTPLUG) += memory_hotplug.o obj-$(CONFIG_MEMTEST) += memtest.o obj-$(CONFIG_MIGRATION) += migrate.o -obj-$(CONFIG_QUICKLIST) += quicklist.o obj-$(CONFIG_TRANSPARENT_HUGEPAGE) += huge_memory.o khugepaged.o obj-$(CONFIG_PAGE_COUNTER) += page_counter.o obj-$(CONFIG_MEMCG) += memcontrol.o vmpressure.o
mm/mmu_gather.c +0 -2
@@ -271,8 +271,6 @@ void tlb_finish_mmu(struct mmu_gather *tlb,tlb_flush_mmu (tlb); -/* keep the page table cache within bounds */ -check_pgt_cache ();#ifndef CONFIG_HAVE_MMU_GATHER_NO_GATHER tlb_batch_list_free (tlb);#endif
mm/quicklist.c deleted +0 -103
103 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 2/3 ia64: switch to generic version of pte allocation
In reply to Mike RapoportThe ia64 implementation pte_alloc_one(), pte_alloc_one_kernel(), pte_free_kernel() and pte_free() is identical to the generic except of lack of __GFP_ACCOUNT for the user PTEs allocation.
Switch ia64 to use generic version of these functions.
--- arch/ia64/include/asm/pgalloc.h | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-)
arch/ia64/include/asm/pgalloc.h +2 -30
@@ -20,6 +20,8 @@#include <linux/page-flags.h> #include <linux/threads.h> +#include <asm-generic/pgalloc.h> +#include <asm/mmu_context.h> static inline pgd_t *pgd_alloc (struct mm_struct *mm)
@@ -82,36 +84,6 @@ pmd_populate_kernel(struct mm_struct *mm, pmd_t * pmd_entry, pte_t * pte) pmd_val(*pmd_entry) = __pa(pte); } -static inline pgtable_t pte_alloc_one (struct mm_struct *mm) -{ -struct page *page; - - page =alloc_page (GFP_KERNEL | __GFP_ZERO); -if (!page) -return NULL ; -if (!pgtable_page_ctor (page)) { -__free_page (page); -return NULL ; - } -return page; -} - -static inline pte_t *pte_alloc_one_kernel (struct mm_struct *mm) -{ -return (pte_t *)__get_free_page (GFP_KERNEL | __GFP_ZERO); -} - -static inline void pte_free (struct mm_struct *mm,pgtable_t pte) -{ -pgtable_page_dtor (pte); -__free_page (pte); -} - -static inline void pte_free_kernel (struct mm_struct *mm,pte_t *pte) -{ -free_page ((unsigned long )pte); -} -#define __pte_free_tlb (tlb, pte, address) pte_free((tlb)->mm, pte)#endif /* _ASM_IA64_PGALLOC_H */
Signature · 1 line
2.7.4
PATCH 3/3 sh: switch to generic version of pte allocation
In reply to Mike RapoportThe sh implementation pte_alloc_one(), pte_alloc_one_kernel(), pte_free_kernel() and pte_free() is identical to the generic except of lack of __GFP_ACCOUNT for the user PTEs allocation.
Switch sh to use generic version of these functions.
--- arch/sh/include/asm/pgalloc.h | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-)
arch/sh/include/asm/pgalloc.h +1 -33
@@ -3,6 +3,7 @@#define __ASM_SH_PGALLOC_H#include <asm/page.h> +#include <asm-generic/pgalloc.h> extern pgd_t *pgd_alloc (struct mm_struct *);extern void pgd_free (struct mm_struct *mm,pgd_t *pgd);
@@ -26,39 +27,6 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, }#define pmd_pgtable (pmd) pmd_page(pmd) -/* -* Allocate and free page tables. -*/ -static inline pte_t *pte_alloc_one_kernel (struct mm_struct *mm) -{ -return (pte_t *)__get_free_page (GFP_KERNEL | __GFP_ZERO); -} - -static inline pgtable_t pte_alloc_one (struct mm_struct *mm) -{ -struct page *page; - - page =alloc_page (GFP_KERNEL | __GFP_ZERO); -if (!page) -return NULL ; -if (!pgtable_page_ctor (page)) { -__free_page (page); -return NULL ; - } -return page; -} - -static inline void pte_free_kernel (struct mm_struct *mm,pte_t *pte) -{ -free_page ((unsigned long )pte); -} - -static inline void pte_free (struct mm_struct *mm,pgtable_t pte) -{ -pgtable_page_dtor (pte); -__free_page (pte); -} -#define __pte_free_tlb (tlb,pte,addr) \ do { \ pgtable_page_dtor(pte); \
Signature · 1 line
2.7.4