aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-22 14:22:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-22 14:22:15 -0400
commit55acdddbac1725b80df0c41970505e8a41c84956 (patch)
treecf0eeda5d382fe40ed3d14b74e9148e587282c0e /arch
parent2eafeb6a415864bc4c59df79151cf40f6ac74b9e (diff)
parentb871a42b6091b720e82ddff237659534c525c25b (diff)
Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull smp/hotplug changes from Ingo Molnar: "Various cleanups to the SMP hotplug code - a continuing effort of Thomas et al" * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: smpboot: Remove leftover declaration smp: Remove num_booting_cpus() smp: Remove ipi_call_lock[_irq]()/ipi_call_unlock[_irq]() POWERPC: Smp: remove call to ipi_call_lock()/ipi_call_unlock() SPARC: SMP: Remove call to ipi_call_lock_irq()/ipi_call_unlock_irq() ia64: SMP: Remove call to ipi_call_lock_irq()/ipi_call_unlock_irq() x86-smp-remove-call-to-ipi_call_lock-ipi_call_unlock tile: SMP: Remove call to ipi_call_lock()/ipi_call_unlock() S390: Smp: remove call to ipi_call_lock()/ipi_call_unlock() parisc: Smp: remove call to ipi_call_lock()/ipi_call_unlock() mn10300: SMP: Remove call to ipi_call_lock()/ipi_call_unlock() hexagon: SMP: Remove call to ipi_call_lock()/ipi_call_unlock()
Diffstat (limited to 'arch')
-rw-r--r--arch/hexagon/kernel/smp.c2
-rw-r--r--arch/ia64/kernel/smpboot.c2
-rw-r--r--arch/m32r/include/asm/smp.h5
-rw-r--r--arch/mn10300/kernel/smp.c2
-rw-r--r--arch/parisc/kernel/smp.c2
-rw-r--r--arch/powerpc/kernel/smp.c2
-rw-r--r--arch/s390/kernel/smp.c2
-rw-r--r--arch/sparc/kernel/smp_64.c7
-rw-r--r--arch/tile/kernel/smpboot.c10
-rw-r--r--arch/x86/include/asm/smp.h5
-rw-r--r--arch/x86/kernel/smpboot.c9
-rw-r--r--arch/x86/xen/smp.c2
12 files changed, 1 insertions, 49 deletions
diff --git a/arch/hexagon/kernel/smp.c b/arch/hexagon/kernel/smp.c
index f7264621e58d..149fbefc1a4d 100644
--- a/arch/hexagon/kernel/smp.c
+++ b/arch/hexagon/kernel/smp.c
@@ -180,9 +180,7 @@ void __cpuinit start_secondary(void)
180 180
181 notify_cpu_starting(cpu); 181 notify_cpu_starting(cpu);
182 182
183 ipi_call_lock();
184 set_cpu_online(cpu, true); 183 set_cpu_online(cpu, true);
185 ipi_call_unlock();
186 184
187 local_irq_enable(); 185 local_irq_enable();
188 186
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index 1113b8aba07f..963d2db53bfa 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -382,7 +382,6 @@ smp_callin (void)
382 set_numa_node(cpu_to_node_map[cpuid]); 382 set_numa_node(cpu_to_node_map[cpuid]);
383 set_numa_mem(local_memory_node(cpu_to_node_map[cpuid])); 383 set_numa_mem(local_memory_node(cpu_to_node_map[cpuid]));
384 384
385 ipi_call_lock_irq();
386 spin_lock(&vector_lock); 385 spin_lock(&vector_lock);
387 /* Setup the per cpu irq handling data structures */ 386 /* Setup the per cpu irq handling data structures */
388 __setup_vector_irq(cpuid); 387 __setup_vector_irq(cpuid);
@@ -390,7 +389,6 @@ smp_callin (void)
390 set_cpu_online(cpuid, true); 389 set_cpu_online(cpuid, true);
391 per_cpu(cpu_state, cpuid) = CPU_ONLINE; 390 per_cpu(cpu_state, cpuid) = CPU_ONLINE;
392 spin_unlock(&vector_lock); 391 spin_unlock(&vector_lock);
393 ipi_call_unlock_irq();
394 392
395 smp_setup_percpu_timer(); 393 smp_setup_percpu_timer();
396 394
diff --git a/arch/m32r/include/asm/smp.h b/arch/m32r/include/asm/smp.h
index cf7829a61551..c689b828dfe2 100644
--- a/arch/m32r/include/asm/smp.h
+++ b/arch/m32r/include/asm/smp.h
@@ -79,11 +79,6 @@ static __inline__ int cpu_number_map(int cpu)
79 return cpu; 79 return cpu;
80} 80}
81 81
82static __inline__ unsigned int num_booting_cpus(void)
83{
84 return cpumask_weight(&cpu_callout_map);
85}
86
87extern void smp_send_timer(void); 82extern void smp_send_timer(void);
88extern unsigned long send_IPI_mask_phys(const cpumask_t*, int, int); 83extern unsigned long send_IPI_mask_phys(const cpumask_t*, int, int);
89 84
diff --git a/arch/mn10300/kernel/smp.c b/arch/mn10300/kernel/smp.c
index 090d35d36973..e62c223e4c45 100644
--- a/arch/mn10300/kernel/smp.c
+++ b/arch/mn10300/kernel/smp.c
@@ -876,9 +876,7 @@ static void __init smp_online(void)
876 876
877 notify_cpu_starting(cpu); 877 notify_cpu_starting(cpu);
878 878
879 ipi_call_lock();
880 set_cpu_online(cpu, true); 879 set_cpu_online(cpu, true);
881 ipi_call_unlock();
882 880
883 local_irq_enable(); 881 local_irq_enable();
884} 882}
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index a47828d31fe6..6266730efd61 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -300,9 +300,7 @@ smp_cpu_init(int cpunum)
300 300
301 notify_cpu_starting(cpunum); 301 notify_cpu_starting(cpunum);
302 302
303 ipi_call_lock();
304 set_cpu_online(cpunum, true); 303 set_cpu_online(cpunum, true);
305 ipi_call_unlock();
306 304
307 /* Initialise the idle task for this CPU */ 305 /* Initialise the idle task for this CPU */
308 atomic_inc(&init_mm.mm_count); 306 atomic_inc(&init_mm.mm_count);
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index e4cb34322de4..e1417c42155c 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -571,7 +571,6 @@ void __devinit start_secondary(void *unused)
571 if (system_state == SYSTEM_RUNNING) 571 if (system_state == SYSTEM_RUNNING)
572 vdso_data->processorCount++; 572 vdso_data->processorCount++;
573#endif 573#endif
574 ipi_call_lock();
575 notify_cpu_starting(cpu); 574 notify_cpu_starting(cpu);
576 set_cpu_online(cpu, true); 575 set_cpu_online(cpu, true);
577 /* Update sibling maps */ 576 /* Update sibling maps */
@@ -601,7 +600,6 @@ void __devinit start_secondary(void *unused)
601 of_node_put(np); 600 of_node_put(np);
602 } 601 }
603 of_node_put(l2_cache); 602 of_node_put(l2_cache);
604 ipi_call_unlock();
605 603
606 local_irq_enable(); 604 local_irq_enable();
607 605
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 15cca26ccb6c..8dca9c248ac7 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -717,9 +717,7 @@ static void __cpuinit smp_start_secondary(void *cpuvoid)
717 init_cpu_vtimer(); 717 init_cpu_vtimer();
718 pfault_init(); 718 pfault_init();
719 notify_cpu_starting(smp_processor_id()); 719 notify_cpu_starting(smp_processor_id());
720 ipi_call_lock();
721 set_cpu_online(smp_processor_id(), true); 720 set_cpu_online(smp_processor_id(), true);
722 ipi_call_unlock();
723 local_irq_enable(); 721 local_irq_enable();
724 /* cpu_idle will call schedule for us */ 722 /* cpu_idle will call schedule for us */
725 cpu_idle(); 723 cpu_idle();
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index f591598d92f6..781bcb10b8bd 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -103,8 +103,6 @@ void __cpuinit smp_callin(void)
103 if (cheetah_pcache_forced_on) 103 if (cheetah_pcache_forced_on)
104 cheetah_enable_pcache(); 104 cheetah_enable_pcache();
105 105
106 local_irq_enable();
107
108 callin_flag = 1; 106 callin_flag = 1;
109 __asm__ __volatile__("membar #Sync\n\t" 107 __asm__ __volatile__("membar #Sync\n\t"
110 "flush %%g6" : : : "memory"); 108 "flush %%g6" : : : "memory");
@@ -124,9 +122,8 @@ void __cpuinit smp_callin(void)
124 while (!cpumask_test_cpu(cpuid, &smp_commenced_mask)) 122 while (!cpumask_test_cpu(cpuid, &smp_commenced_mask))
125 rmb(); 123 rmb();
126 124
127 ipi_call_lock_irq();
128 set_cpu_online(cpuid, true); 125 set_cpu_online(cpuid, true);
129 ipi_call_unlock_irq(); 126 local_irq_enable();
130 127
131 /* idle thread is expected to have preempt disabled */ 128 /* idle thread is expected to have preempt disabled */
132 preempt_disable(); 129 preempt_disable();
@@ -1308,9 +1305,7 @@ int __cpu_disable(void)
1308 mdelay(1); 1305 mdelay(1);
1309 local_irq_disable(); 1306 local_irq_disable();
1310 1307
1311 ipi_call_lock();
1312 set_cpu_online(cpu, false); 1308 set_cpu_online(cpu, false);
1313 ipi_call_unlock();
1314 1309
1315 cpu_map_rebuild(); 1310 cpu_map_rebuild();
1316 1311
diff --git a/arch/tile/kernel/smpboot.c b/arch/tile/kernel/smpboot.c
index 84873fbe8f27..e686c5ac90be 100644
--- a/arch/tile/kernel/smpboot.c
+++ b/arch/tile/kernel/smpboot.c
@@ -198,17 +198,7 @@ void __cpuinit online_secondary(void)
198 198
199 notify_cpu_starting(smp_processor_id()); 199 notify_cpu_starting(smp_processor_id());
200 200
201 /*
202 * We need to hold call_lock, so there is no inconsistency
203 * between the time smp_call_function() determines number of
204 * IPI recipients, and the time when the determination is made
205 * for which cpus receive the IPI. Holding this
206 * lock helps us to not include this cpu in a currently in progress
207 * smp_call_function().
208 */
209 ipi_call_lock();
210 set_cpu_online(smp_processor_id(), 1); 201 set_cpu_online(smp_processor_id(), 1);
211 ipi_call_unlock();
212 __get_cpu_var(cpu_state) = CPU_ONLINE; 202 __get_cpu_var(cpu_state) = CPU_ONLINE;
213 203
214 /* Set up tile-specific state for this cpu. */ 204 /* Set up tile-specific state for this cpu. */
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index f48394513c37..2ffa95dc2333 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -169,11 +169,6 @@ void x86_idle_thread_init(unsigned int cpu, struct task_struct *idle);
169void smp_store_cpu_info(int id); 169void smp_store_cpu_info(int id);
170#define cpu_physical_id(cpu) per_cpu(x86_cpu_to_apicid, cpu) 170#define cpu_physical_id(cpu) per_cpu(x86_cpu_to_apicid, cpu)
171 171
172/* We don't mark CPUs online until __cpu_up(), so we need another measure */
173static inline int num_booting_cpus(void)
174{
175 return cpumask_weight(cpu_callout_mask);
176}
177#else /* !CONFIG_SMP */ 172#else /* !CONFIG_SMP */
178#define wbinvd_on_cpu(cpu) wbinvd() 173#define wbinvd_on_cpu(cpu) wbinvd()
179static inline int wbinvd_on_all_cpus(void) 174static inline int wbinvd_on_all_cpus(void)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 7bd8a0823654..27e2eeff7a4b 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -255,22 +255,13 @@ notrace static void __cpuinit start_secondary(void *unused)
255 check_tsc_sync_target(); 255 check_tsc_sync_target();
256 256
257 /* 257 /*
258 * We need to hold call_lock, so there is no inconsistency
259 * between the time smp_call_function() determines number of
260 * IPI recipients, and the time when the determination is made
261 * for which cpus receive the IPI. Holding this
262 * lock helps us to not include this cpu in a currently in progress
263 * smp_call_function().
264 *
265 * We need to hold vector_lock so there the set of online cpus 258 * We need to hold vector_lock so there the set of online cpus
266 * does not change while we are assigning vectors to cpus. Holding 259 * does not change while we are assigning vectors to cpus. Holding
267 * this lock ensures we don't half assign or remove an irq from a cpu. 260 * this lock ensures we don't half assign or remove an irq from a cpu.
268 */ 261 */
269 ipi_call_lock();
270 lock_vector_lock(); 262 lock_vector_lock();
271 set_cpu_online(smp_processor_id(), true); 263 set_cpu_online(smp_processor_id(), true);
272 unlock_vector_lock(); 264 unlock_vector_lock();
273 ipi_call_unlock();
274 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE; 265 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
275 x86_platform.nmi_init(); 266 x86_platform.nmi_init();
276 267
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index afb250d22a6b..f58dca7a6e52 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -80,9 +80,7 @@ static void __cpuinit cpu_bringup(void)
80 80
81 notify_cpu_starting(cpu); 81 notify_cpu_starting(cpu);
82 82
83 ipi_call_lock();
84 set_cpu_online(cpu, true); 83 set_cpu_online(cpu, true);
85 ipi_call_unlock();
86 84
87 this_cpu_write(cpu_state, CPU_ONLINE); 85 this_cpu_write(cpu_state, CPU_ONLINE);
88 86