aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/smpboot.c
diff options
context:
space:
mode:
authorAndreas Mohr <andi@rhlx01.fht-esslingen.de>2006-06-25 08:46:52 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 13:00:55 -0400
commit186989177e627c2571a3026d39ea1433e4ddc097 (patch)
treefacbda2b471468dfc3b483c6711094e8495e0eec /arch/i386/kernel/smpboot.c
parente75eac33b5c7f797e4b2ddcb39183cf268e26822 (diff)
[PATCH] cpu_relax(): smpboot.c
Add cpu_relax() to various smpboot.c init loops. cpu_relax() always implies a barrier (according to Arjan), so remove those as well. Signed-off-by: Andreas Mohr <andi@lisas.de> Cc: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/smpboot.c')
-rw-r--r--arch/i386/kernel/smpboot.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index 825b2b4ca721..bd0ca5c9f053 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -257,7 +257,7 @@ static void __init synchronize_tsc_bp (void)
257 * all APs synchronize but they loop on '== num_cpus' 257 * all APs synchronize but they loop on '== num_cpus'
258 */ 258 */
259 while (atomic_read(&tsc_count_start) != num_booting_cpus()-1) 259 while (atomic_read(&tsc_count_start) != num_booting_cpus()-1)
260 mb(); 260 cpu_relax();
261 atomic_set(&tsc_count_stop, 0); 261 atomic_set(&tsc_count_stop, 0);
262 wmb(); 262 wmb();
263 /* 263 /*
@@ -276,7 +276,7 @@ static void __init synchronize_tsc_bp (void)
276 * Wait for all APs to leave the synchronization point: 276 * Wait for all APs to leave the synchronization point:
277 */ 277 */
278 while (atomic_read(&tsc_count_stop) != num_booting_cpus()-1) 278 while (atomic_read(&tsc_count_stop) != num_booting_cpus()-1)
279 mb(); 279 cpu_relax();
280 atomic_set(&tsc_count_start, 0); 280 atomic_set(&tsc_count_start, 0);
281 wmb(); 281 wmb();
282 atomic_inc(&tsc_count_stop); 282 atomic_inc(&tsc_count_stop);
@@ -333,19 +333,21 @@ static void __init synchronize_tsc_ap (void)
333 * this gets called, so we first wait for the BP to 333 * this gets called, so we first wait for the BP to
334 * finish SMP initialization: 334 * finish SMP initialization:
335 */ 335 */
336 while (!atomic_read(&tsc_start_flag)) mb(); 336 while (!atomic_read(&tsc_start_flag))
337 cpu_relax();
337 338
338 for (i = 0; i < NR_LOOPS; i++) { 339 for (i = 0; i < NR_LOOPS; i++) {
339 atomic_inc(&tsc_count_start); 340 atomic_inc(&tsc_count_start);
340 while (atomic_read(&tsc_count_start) != num_booting_cpus()) 341 while (atomic_read(&tsc_count_start) != num_booting_cpus())
341 mb(); 342 cpu_relax();
342 343
343 rdtscll(tsc_values[smp_processor_id()]); 344 rdtscll(tsc_values[smp_processor_id()]);
344 if (i == NR_LOOPS-1) 345 if (i == NR_LOOPS-1)
345 write_tsc(0, 0); 346 write_tsc(0, 0);
346 347
347 atomic_inc(&tsc_count_stop); 348 atomic_inc(&tsc_count_stop);
348 while (atomic_read(&tsc_count_stop) != num_booting_cpus()) mb(); 349 while (atomic_read(&tsc_count_stop) != num_booting_cpus())
350 cpu_relax();
349 } 351 }
350} 352}
351#undef NR_LOOPS 353#undef NR_LOOPS
@@ -1433,7 +1435,7 @@ int __devinit __cpu_up(unsigned int cpu)
1433 /* Unleash the CPU! */ 1435 /* Unleash the CPU! */
1434 cpu_set(cpu, smp_commenced_mask); 1436 cpu_set(cpu, smp_commenced_mask);
1435 while (!cpu_isset(cpu, cpu_online_map)) 1437 while (!cpu_isset(cpu, cpu_online_map))
1436 mb(); 1438 cpu_relax();
1437 return 0; 1439 return 0;
1438} 1440}
1439 1441