aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authortravis@sgi.com <travis@sgi.com>2008-01-30 07:33:11 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:33:11 -0500
commit24b0d22b7b63bfc71853faf64e76cd45701ecf2a (patch)
treeaa8a08a5dce827cdee70b9774f2cf66615b5c4c3 /arch/x86
parent2c6b8c030cfca334c3d700ee504036c585c4c6a3 (diff)
x86: change NR_CPUS arrays in smpboot_64
Change the following static arrays sized by NR_CPUS to per_cpu data variables: task_struct *idle_thread_array[NR_CPUS]; This is only done if CONFIG_HOTPLUG_CPU is defined as otherwise, the array is removed after initialization anyways. Signed-off-by: Mike Travis <travis@sgi.com> Reviewed-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/smpboot_64.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c
index 1fea185c9dca..50e207a8261f 100644
--- a/arch/x86/kernel/smpboot_64.c
+++ b/arch/x86/kernel/smpboot_64.c
@@ -111,10 +111,20 @@ DEFINE_PER_CPU(int, cpu_state) = { 0 };
111 * a new thread. Also avoids complicated thread destroy functionality 111 * a new thread. Also avoids complicated thread destroy functionality
112 * for idle threads. 112 * for idle threads.
113 */ 113 */
114#ifdef CONFIG_HOTPLUG_CPU
115/*
116 * Needed only for CONFIG_HOTPLUG_CPU because __cpuinitdata is
117 * removed after init for !CONFIG_HOTPLUG_CPU.
118 */
119static DEFINE_PER_CPU(struct task_struct *, idle_thread_array);
120#define get_idle_for_cpu(x) (per_cpu(idle_thread_array, x))
121#define set_idle_for_cpu(x,p) (per_cpu(idle_thread_array, x) = (p))
122#else
114struct task_struct *idle_thread_array[NR_CPUS] __cpuinitdata ; 123struct task_struct *idle_thread_array[NR_CPUS] __cpuinitdata ;
115
116#define get_idle_for_cpu(x) (idle_thread_array[(x)]) 124#define get_idle_for_cpu(x) (idle_thread_array[(x)])
117#define set_idle_for_cpu(x,p) (idle_thread_array[(x)] = (p)) 125#define set_idle_for_cpu(x,p) (idle_thread_array[(x)] = (p))
126#endif
127
118 128
119/* 129/*
120 * Currently trivial. Write the real->protected mode 130 * Currently trivial. Write the real->protected mode