diff options
author | Tejun Heo <tj@kernel.org> | 2009-01-13 06:41:35 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-16 08:19:40 -0500 |
commit | c8f3329a0ddd751241e96b4100df7eda14b2cbc6 (patch) | |
tree | 55e201da3d0d26076d4e31ef68aad26bf9f3e08c /arch/x86/kernel/setup_percpu.c | |
parent | f32ff5388d86518c0375ccdb330d3b459b9c405e (diff) |
x86: use static _cpu_pda array
_cpu_pda array first uses statically allocated storage in data.init
and then switches to allocated bootmem to conserve space. However,
after folding pda area into percpu area, _cpu_pda array will be
removed completely. Drop the reallocation part to simplify the code
for soon-to-follow changes.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/setup_percpu.c')
-rw-r--r-- | arch/x86/kernel/setup_percpu.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c index 44845842e722..73ab01b297c5 100644 --- a/arch/x86/kernel/setup_percpu.c +++ b/arch/x86/kernel/setup_percpu.c | |||
@@ -114,7 +114,6 @@ static inline void setup_cpu_pda_map(void) { } | |||
114 | static void __init setup_cpu_pda_map(void) | 114 | static void __init setup_cpu_pda_map(void) |
115 | { | 115 | { |
116 | char *pda; | 116 | char *pda; |
117 | struct x8664_pda **new_cpu_pda; | ||
118 | unsigned long size; | 117 | unsigned long size; |
119 | int cpu; | 118 | int cpu; |
120 | 119 | ||
@@ -122,28 +121,21 @@ static void __init setup_cpu_pda_map(void) | |||
122 | 121 | ||
123 | /* allocate cpu_pda array and pointer table */ | 122 | /* allocate cpu_pda array and pointer table */ |
124 | { | 123 | { |
125 | unsigned long tsize = nr_cpu_ids * sizeof(void *); | ||
126 | unsigned long asize = size * (nr_cpu_ids - 1); | 124 | unsigned long asize = size * (nr_cpu_ids - 1); |
127 | 125 | ||
128 | tsize = roundup(tsize, cache_line_size()); | 126 | pda = alloc_bootmem(asize); |
129 | new_cpu_pda = alloc_bootmem(tsize + asize); | ||
130 | pda = (char *)new_cpu_pda + tsize; | ||
131 | } | 127 | } |
132 | 128 | ||
133 | /* initialize pointer table to static pda's */ | 129 | /* initialize pointer table to static pda's */ |
134 | for_each_possible_cpu(cpu) { | 130 | for_each_possible_cpu(cpu) { |
135 | if (cpu == 0) { | 131 | if (cpu == 0) { |
136 | /* leave boot cpu pda in place */ | 132 | /* leave boot cpu pda in place */ |
137 | new_cpu_pda[0] = cpu_pda(0); | ||
138 | continue; | 133 | continue; |
139 | } | 134 | } |
140 | new_cpu_pda[cpu] = (struct x8664_pda *)pda; | 135 | cpu_pda(cpu) = (struct x8664_pda *)pda; |
141 | new_cpu_pda[cpu]->in_bootmem = 1; | 136 | cpu_pda(cpu)->in_bootmem = 1; |
142 | pda += size; | 137 | pda += size; |
143 | } | 138 | } |
144 | |||
145 | /* point to new pointer table */ | ||
146 | _cpu_pda = new_cpu_pda; | ||
147 | } | 139 | } |
148 | 140 | ||
149 | #endif /* CONFIG_SMP && CONFIG_X86_64 */ | 141 | #endif /* CONFIG_SMP && CONFIG_X86_64 */ |