diff options
author | Mike Travis <travis@sgi.com> | 2008-05-12 15:21:13 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 05:31:25 -0400 |
commit | 3461b0af025251bbc6b3d56c821c6ac2de6f7209 (patch) | |
tree | 5350ad712311a69b4b59deec1ec60d8573db8817 /arch/x86/kernel/head64.c | |
parent | 9f248bde9d47cc177011198c9a15fb339b9f3215 (diff) |
x86: remove static boot_cpu_pda array v2
* Remove the boot_cpu_pda array and pointer table from the data section.
Allocate the pointer table and array during init. do_boot_cpu()
will reallocate the pda in node local memory and if the cpu is being
brought up before the bootmem array is released (after_bootmem = 0),
then it will free the initial pda. This will happen for all cpus
present at system startup.
This removes 512k + 32k bytes from the data section.
For inclusion into sched-devel/latest tree.
Based on:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
+ sched-devel/latest .../mingo/linux-2.6-sched-devel.git
Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/head64.c')
-rw-r--r-- | arch/x86/kernel/head64.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index e25c57b8aa84..0ab59edd7067 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c | |||
@@ -25,6 +25,24 @@ | |||
25 | #include <asm/e820.h> | 25 | #include <asm/e820.h> |
26 | #include <asm/bios_ebda.h> | 26 | #include <asm/bios_ebda.h> |
27 | 27 | ||
28 | /* boot cpu pda */ | ||
29 | static struct x8664_pda _boot_cpu_pda __read_mostly; | ||
30 | |||
31 | #ifdef CONFIG_SMP | ||
32 | #ifdef CONFIG_DEBUG_PER_CPU_MAPS | ||
33 | /* | ||
34 | * We install an empty cpu_pda pointer table to trap references before | ||
35 | * the actual cpu_pda pointer table is created in setup_cpu_pda_map(). | ||
36 | */ | ||
37 | static struct x8664_pda *__cpu_pda[NR_CPUS] __initdata; | ||
38 | #else | ||
39 | static struct x8664_pda *__cpu_pda[1] __read_mostly; | ||
40 | #endif | ||
41 | |||
42 | #else /* !CONFIG_SMP (NR_CPUS will be 1) */ | ||
43 | static struct x8664_pda *__cpu_pda[NR_CPUS] __read_mostly; | ||
44 | #endif | ||
45 | |||
28 | static void __init zap_identity_mappings(void) | 46 | static void __init zap_identity_mappings(void) |
29 | { | 47 | { |
30 | pgd_t *pgd = pgd_offset_k(0UL); | 48 | pgd_t *pgd = pgd_offset_k(0UL); |
@@ -156,10 +174,12 @@ void __init x86_64_start_kernel(char * real_mode_data) | |||
156 | 174 | ||
157 | early_printk("Kernel alive\n"); | 175 | early_printk("Kernel alive\n"); |
158 | 176 | ||
159 | for (i = 0; i < NR_CPUS; i++) | 177 | _cpu_pda = __cpu_pda; |
160 | cpu_pda(i) = &boot_cpu_pda[i]; | 178 | cpu_pda(0) = &_boot_cpu_pda; |
161 | |||
162 | pda_init(0); | 179 | pda_init(0); |
180 | |||
181 | early_printk("Kernel really alive\n"); | ||
182 | |||
163 | copy_bootdata(__va(real_mode_data)); | 183 | copy_bootdata(__va(real_mode_data)); |
164 | 184 | ||
165 | reserve_early(__pa_symbol(&_text), __pa_symbol(&_end), "TEXT DATA BSS"); | 185 | reserve_early(__pa_symbol(&_text), __pa_symbol(&_end), "TEXT DATA BSS"); |