Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "x86_64: Quicklist support for x86_64"

This reverts commit 34feb2c83beb3bdf13535a36770f7e50b47ef299.

Suresh Siddha points out that this one breaks the fundamental
requirement that you cannot free page table pages before the TLB caches
are flushed. The quicklists do not give the same kinds of guarantees
that the mmu_gather structure does, at least not in NUMA configurations.

Requested-by: Suresh Siddha <suresh.b.siddha@intel.com>
Acked-by: Andi Kleen <ak@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Asit Mallick <asit.k.mallick@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+31 -64
-8
arch/x86_64/Kconfig
··· 60 60 bool 61 61 default y 62 62 63 - config QUICKLIST 64 - bool 65 - default y 66 - 67 - config NR_QUICK 68 - int 69 - default 2 70 - 71 63 config ISA 72 64 bool 73 65
-1
arch/x86_64/kernel/process.c
··· 208 208 if (__get_cpu_var(cpu_idle_state)) 209 209 __get_cpu_var(cpu_idle_state) = 0; 210 210 211 - check_pgt_cache(); 212 211 rmb(); 213 212 idle = pm_idle; 214 213 if (!idle)
+1 -1
arch/x86_64/kernel/smp.c
··· 241 241 } 242 242 if (!cpus_empty(cpu_mask)) 243 243 flush_tlb_others(cpu_mask, mm, FLUSH_ALL); 244 - check_pgt_cache(); 244 + 245 245 preempt_enable(); 246 246 } 247 247 EXPORT_SYMBOL(flush_tlb_mm);
+29 -54
include/asm-x86_64/pgalloc.h
··· 4 4 #include <asm/pda.h> 5 5 #include <linux/threads.h> 6 6 #include <linux/mm.h> 7 - #include <linux/quicklist.h> 8 - 9 - #define QUICK_PGD 0 /* We preserve special mappings over free */ 10 - #define QUICK_PT 1 /* Other page table pages that are zero on free */ 11 7 12 8 #define pmd_populate_kernel(mm, pmd, pte) \ 13 9 set_pmd(pmd, __pmd(_PAGE_TABLE | __pa(pte))) ··· 20 24 static inline void pmd_free(pmd_t *pmd) 21 25 { 22 26 BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); 23 - quicklist_free(QUICK_PT, NULL, pmd); 27 + free_page((unsigned long)pmd); 24 28 } 25 29 26 30 static inline pmd_t *pmd_alloc_one (struct mm_struct *mm, unsigned long addr) 27 31 { 28 - return (pmd_t *)quicklist_alloc(QUICK_PT, GFP_KERNEL|__GFP_REPEAT, NULL); 32 + return (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); 29 33 } 30 34 31 35 static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) 32 36 { 33 - return (pud_t *)quicklist_alloc(QUICK_PT, GFP_KERNEL|__GFP_REPEAT, NULL); 37 + return (pud_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); 34 38 } 35 39 36 40 static inline void pud_free (pud_t *pud) 37 41 { 38 42 BUG_ON((unsigned long)pud & (PAGE_SIZE-1)); 39 - quicklist_free(QUICK_PT, NULL, pud); 43 + free_page((unsigned long)pud); 40 44 } 41 45 42 46 static inline void pgd_list_add(pgd_t *pgd) ··· 57 61 spin_unlock(&pgd_lock); 58 62 } 59 63 60 - static inline void pgd_ctor(void *x) 61 - { 62 - unsigned boundary; 63 - pgd_t *pgd = x; 64 - struct page *page = virt_to_page(pgd); 65 - 66 - /* 67 - * Copy kernel pointers in from init. 68 - */ 69 - boundary = pgd_index(__PAGE_OFFSET); 70 - memcpy(pgd + boundary, 71 - init_level4_pgt + boundary, 72 - (PTRS_PER_PGD - boundary) * sizeof(pgd_t)); 73 - 74 - spin_lock(&pgd_lock); 75 - list_add(&page->lru, &pgd_list); 76 - spin_unlock(&pgd_lock); 77 - } 78 - 79 - static inline void pgd_dtor(void *x) 80 - { 81 - pgd_t *pgd = x; 82 - struct page *page = virt_to_page(pgd); 83 - 84 - spin_lock(&pgd_lock); 85 - list_del(&page->lru); 86 - spin_unlock(&pgd_lock); 87 - } 88 - 89 64 static inline pgd_t *pgd_alloc(struct mm_struct *mm) 90 65 { 91 - pgd_t *pgd = (pgd_t *)quicklist_alloc(QUICK_PGD, 92 - GFP_KERNEL|__GFP_REPEAT, pgd_ctor); 66 + unsigned boundary; 67 + pgd_t *pgd = (pgd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); 68 + if (!pgd) 69 + return NULL; 70 + pgd_list_add(pgd); 71 + /* 72 + * Copy kernel pointers in from init. 73 + * Could keep a freelist or slab cache of those because the kernel 74 + * part never changes. 75 + */ 76 + boundary = pgd_index(__PAGE_OFFSET); 77 + memset(pgd, 0, boundary * sizeof(pgd_t)); 78 + memcpy(pgd + boundary, 79 + init_level4_pgt + boundary, 80 + (PTRS_PER_PGD - boundary) * sizeof(pgd_t)); 93 81 return pgd; 94 82 } 95 83 96 84 static inline void pgd_free(pgd_t *pgd) 97 85 { 98 86 BUG_ON((unsigned long)pgd & (PAGE_SIZE-1)); 99 - quicklist_free(QUICK_PGD, pgd_dtor, pgd); 87 + pgd_list_del(pgd); 88 + free_page((unsigned long)pgd); 100 89 } 101 90 102 91 static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) 103 92 { 104 - return (pte_t *)quicklist_alloc(QUICK_PT, GFP_KERNEL|__GFP_REPEAT, NULL); 93 + return (pte_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); 105 94 } 106 95 107 96 static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) 108 97 { 109 - void *p = (void *)quicklist_alloc(QUICK_PT, GFP_KERNEL|__GFP_REPEAT, NULL); 110 - 98 + void *p = (void *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); 111 99 if (!p) 112 100 return NULL; 113 101 return virt_to_page(p); ··· 103 123 static inline void pte_free_kernel(pte_t *pte) 104 124 { 105 125 BUG_ON((unsigned long)pte & (PAGE_SIZE-1)); 106 - quicklist_free(QUICK_PT, NULL, pte); 126 + free_page((unsigned long)pte); 107 127 } 108 128 109 129 static inline void pte_free(struct page *pte) 110 130 { 111 - quicklist_free_page(QUICK_PT, NULL, pte); 112 - } 131 + __free_page(pte); 132 + } 113 133 114 - #define __pte_free_tlb(tlb,pte) quicklist_free_page(QUICK_PT, NULL,(pte)) 134 + #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) 115 135 116 - #define __pmd_free_tlb(tlb,x) quicklist_free(QUICK_PT, NULL, (x)) 117 - #define __pud_free_tlb(tlb,x) quicklist_free(QUICK_PT, NULL, (x)) 136 + #define __pmd_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x)) 137 + #define __pud_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x)) 118 138 119 - static inline void check_pgt_cache(void) 120 - { 121 - quicklist_trim(QUICK_PGD, pgd_dtor, 25, 16); 122 - quicklist_trim(QUICK_PT, NULL, 25, 16); 123 - } 124 139 #endif /* _X86_64_PGALLOC_H */
+1
include/asm-x86_64/pgtable.h
··· 411 411 #define HAVE_ARCH_UNMAPPED_AREA 412 412 413 413 #define pgtable_cache_init() do { } while (0) 414 + #define check_pgt_cache() do { } while (0) 414 415 415 416 #define PAGE_AGP PAGE_KERNEL_NOCACHE 416 417 #define HAVE_PAGE_AGP 1