diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:33:58 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:33:58 -0500 |
commit | 12d6f21eacc21d84a809829543f2fe45c7e37319 (patch) | |
tree | 6985f2370ad238fb2a568547a5049751d7c95a69 | |
parent | 9a3dc7804e9856668caef41efc54179e61ffccc0 (diff) |
x86: do not PSE on CONFIG_DEBUG_PAGEALLOC=y
get more testing of the c_p_a() code done by not turning off
PSE on DEBUG_PAGEALLOC.
this simplifies the early pagetable setup code, and tests
the largepage-splitup code quite heavily.
In the end, all the largepages will be split up pretty quickly,
so there's no difference to how DEBUG_PAGEALLOC worked before.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 7 | ||||
-rw-r--r-- | arch/x86/mm/pageattr_32.c | 12 | ||||
-rw-r--r-- | include/asm-x86/cacheflush.h | 5 | ||||
-rw-r--r-- | include/linux/mm.h | 14 | ||||
-rw-r--r-- | init/main.c | 5 |
5 files changed, 29 insertions, 14 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index bba850b05d0e..db28aa9e2f69 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -641,13 +641,6 @@ void __init early_cpu_init(void) | |||
641 | nexgen_init_cpu(); | 641 | nexgen_init_cpu(); |
642 | umc_init_cpu(); | 642 | umc_init_cpu(); |
643 | early_cpu_detect(); | 643 | early_cpu_detect(); |
644 | |||
645 | #ifdef CONFIG_DEBUG_PAGEALLOC | ||
646 | /* pse is not compatible with on-the-fly unmapping, | ||
647 | * disable it even if the cpus claim to support it. | ||
648 | */ | ||
649 | setup_clear_cpu_cap(X86_FEATURE_PSE); | ||
650 | #endif | ||
651 | } | 644 | } |
652 | 645 | ||
653 | /* Make sure %fs is initialized properly in idle threads */ | 646 | /* Make sure %fs is initialized properly in idle threads */ |
diff --git a/arch/x86/mm/pageattr_32.c b/arch/x86/mm/pageattr_32.c index 9cf2fea54eb5..dd49b16b3a0e 100644 --- a/arch/x86/mm/pageattr_32.c +++ b/arch/x86/mm/pageattr_32.c | |||
@@ -61,13 +61,17 @@ static void __set_pmd_pte(pte_t *kpte, unsigned long address, pte_t pte) | |||
61 | static int split_large_page(pte_t *kpte, unsigned long address) | 61 | static int split_large_page(pte_t *kpte, unsigned long address) |
62 | { | 62 | { |
63 | pgprot_t ref_prot = pte_pgprot(pte_clrhuge(*kpte)); | 63 | pgprot_t ref_prot = pte_pgprot(pte_clrhuge(*kpte)); |
64 | gfp_t gfp_flags = GFP_KERNEL; | ||
64 | unsigned long flags; | 65 | unsigned long flags; |
65 | unsigned long addr; | 66 | unsigned long addr; |
66 | pte_t *pbase, *tmp; | 67 | pte_t *pbase, *tmp; |
67 | struct page *base; | 68 | struct page *base; |
68 | int i, level; | 69 | int i, level; |
69 | 70 | ||
70 | base = alloc_pages(GFP_KERNEL, 0); | 71 | #ifdef CONFIG_DEBUG_PAGEALLOC |
72 | gfp_flags = GFP_ATOMIC; | ||
73 | #endif | ||
74 | base = alloc_pages(gfp_flags, 0); | ||
71 | if (!base) | 75 | if (!base) |
72 | return -ENOMEM; | 76 | return -ENOMEM; |
73 | 77 | ||
@@ -219,6 +223,12 @@ void kernel_map_pages(struct page *page, int numpages, int enable) | |||
219 | } | 223 | } |
220 | 224 | ||
221 | /* | 225 | /* |
226 | * If page allocator is not up yet then do not call c_p_a(): | ||
227 | */ | ||
228 | if (!debug_pagealloc_enabled) | ||
229 | return; | ||
230 | |||
231 | /* | ||
222 | * the return value is ignored - the calls cannot fail, | 232 | * the return value is ignored - the calls cannot fail, |
223 | * large pages are disabled at boot time. | 233 | * large pages are disabled at boot time. |
224 | */ | 234 | */ |
diff --git a/include/asm-x86/cacheflush.h b/include/asm-x86/cacheflush.h index 9411a2d3f19c..fccb563e2305 100644 --- a/include/asm-x86/cacheflush.h +++ b/include/asm-x86/cacheflush.h | |||
@@ -29,11 +29,6 @@ int change_page_attr(struct page *page, int numpages, pgprot_t prot); | |||
29 | int change_page_attr_addr(unsigned long addr, int numpages, pgprot_t prot); | 29 | int change_page_attr_addr(unsigned long addr, int numpages, pgprot_t prot); |
30 | void clflush_cache_range(void *addr, int size); | 30 | void clflush_cache_range(void *addr, int size); |
31 | 31 | ||
32 | #ifdef CONFIG_DEBUG_PAGEALLOC | ||
33 | /* internal debugging function */ | ||
34 | void kernel_map_pages(struct page *page, int numpages, int enable); | ||
35 | #endif | ||
36 | |||
37 | #ifdef CONFIG_DEBUG_RODATA | 32 | #ifdef CONFIG_DEBUG_RODATA |
38 | void mark_rodata_ro(void); | 33 | void mark_rodata_ro(void); |
39 | #endif | 34 | #endif |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 3c22d971afa7..1bba6789a50a 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1118,9 +1118,21 @@ static inline void vm_stat_account(struct mm_struct *mm, | |||
1118 | } | 1118 | } |
1119 | #endif /* CONFIG_PROC_FS */ | 1119 | #endif /* CONFIG_PROC_FS */ |
1120 | 1120 | ||
1121 | #ifndef CONFIG_DEBUG_PAGEALLOC | 1121 | #ifdef CONFIG_DEBUG_PAGEALLOC |
1122 | extern int debug_pagealloc_enabled; | ||
1123 | |||
1124 | extern void kernel_map_pages(struct page *page, int numpages, int enable); | ||
1125 | |||
1126 | static inline void enable_debug_pagealloc(void) | ||
1127 | { | ||
1128 | debug_pagealloc_enabled = 1; | ||
1129 | } | ||
1130 | #else | ||
1122 | static inline void | 1131 | static inline void |
1123 | kernel_map_pages(struct page *page, int numpages, int enable) {} | 1132 | kernel_map_pages(struct page *page, int numpages, int enable) {} |
1133 | static inline void enable_debug_pagealloc(void) | ||
1134 | { | ||
1135 | } | ||
1124 | #endif | 1136 | #endif |
1125 | 1137 | ||
1126 | extern struct vm_area_struct *get_gate_vma(struct task_struct *tsk); | 1138 | extern struct vm_area_struct *get_gate_vma(struct task_struct *tsk); |
diff --git a/init/main.c b/init/main.c index 3316dffe3e57..cb81ed116f62 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -318,6 +318,10 @@ static int __init unknown_bootoption(char *param, char *val) | |||
318 | return 0; | 318 | return 0; |
319 | } | 319 | } |
320 | 320 | ||
321 | #ifdef CONFIG_DEBUG_PAGEALLOC | ||
322 | int __read_mostly debug_pagealloc_enabled = 0; | ||
323 | #endif | ||
324 | |||
321 | static int __init init_setup(char *str) | 325 | static int __init init_setup(char *str) |
322 | { | 326 | { |
323 | unsigned int i; | 327 | unsigned int i; |
@@ -552,6 +556,7 @@ asmlinkage void __init start_kernel(void) | |||
552 | preempt_disable(); | 556 | preempt_disable(); |
553 | build_all_zonelists(); | 557 | build_all_zonelists(); |
554 | page_alloc_init(); | 558 | page_alloc_init(); |
559 | enable_debug_pagealloc(); | ||
555 | printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line); | 560 | printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line); |
556 | parse_early_param(); | 561 | parse_early_param(); |
557 | parse_args("Booting kernel", static_command_line, __start___param, | 562 | parse_args("Booting kernel", static_command_line, __start___param, |