Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29634
b: refs/heads/master
c: 1869891
h: refs/heads/master
v: v3
  • Loading branch information
Andreas Mohr authored and Linus Torvalds committed Jun 25, 2006
1 parent 9842331 commit 3325478
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e75eac33b5c7f797e4b2ddcb39183cf268e26822
refs/heads/master: 186989177e627c2571a3026d39ea1433e4ddc097
14 changes: 8 additions & 6 deletions trunk/arch/i386/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ static void __init synchronize_tsc_bp (void)
* all APs synchronize but they loop on '== num_cpus'
*/
while (atomic_read(&tsc_count_start) != num_booting_cpus()-1)
mb();
cpu_relax();
atomic_set(&tsc_count_stop, 0);
wmb();
/*
Expand All @@ -276,7 +276,7 @@ static void __init synchronize_tsc_bp (void)
* Wait for all APs to leave the synchronization point:
*/
while (atomic_read(&tsc_count_stop) != num_booting_cpus()-1)
mb();
cpu_relax();
atomic_set(&tsc_count_start, 0);
wmb();
atomic_inc(&tsc_count_stop);
Expand Down Expand Up @@ -333,19 +333,21 @@ static void __init synchronize_tsc_ap (void)
* this gets called, so we first wait for the BP to
* finish SMP initialization:
*/
while (!atomic_read(&tsc_start_flag)) mb();
while (!atomic_read(&tsc_start_flag))
cpu_relax();

for (i = 0; i < NR_LOOPS; i++) {
atomic_inc(&tsc_count_start);
while (atomic_read(&tsc_count_start) != num_booting_cpus())
mb();
cpu_relax();

rdtscll(tsc_values[smp_processor_id()]);
if (i == NR_LOOPS-1)
write_tsc(0, 0);

atomic_inc(&tsc_count_stop);
while (atomic_read(&tsc_count_stop) != num_booting_cpus()) mb();
while (atomic_read(&tsc_count_stop) != num_booting_cpus())
cpu_relax();
}
}
#undef NR_LOOPS
Expand Down Expand Up @@ -1433,7 +1435,7 @@ int __devinit __cpu_up(unsigned int cpu)
/* Unleash the CPU! */
cpu_set(cpu, smp_commenced_mask);
while (!cpu_isset(cpu, cpu_online_map))
mb();
cpu_relax();
return 0;
}

Expand Down

0 comments on commit 3325478

Please sign in to comment.