Commit d73dee6e authored by Tony Luck's avatar Tony Luck

Pull for-each-cpu into release branch

parents 9acd3fa2 ddf6d0a0
...@@ -57,9 +57,9 @@ int show_interrupts(struct seq_file *p, void *v) ...@@ -57,9 +57,9 @@ int show_interrupts(struct seq_file *p, void *v)
if (i == 0) { if (i == 0) {
seq_printf(p, " "); seq_printf(p, " ");
for (j=0; j<NR_CPUS; j++) for_each_online_cpu(j) {
if (cpu_online(j)) seq_printf(p, "CPU%d ",j);
seq_printf(p, "CPU%d ",j); }
seq_putc(p, '\n'); seq_putc(p, '\n');
} }
...@@ -72,9 +72,9 @@ int show_interrupts(struct seq_file *p, void *v) ...@@ -72,9 +72,9 @@ int show_interrupts(struct seq_file *p, void *v)
#ifndef CONFIG_SMP #ifndef CONFIG_SMP
seq_printf(p, "%10u ", kstat_irqs(i)); seq_printf(p, "%10u ", kstat_irqs(i));
#else #else
for (j = 0; j < NR_CPUS; j++) for_each_online_cpu(j) {
if (cpu_online(j)) seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); }
#endif #endif
seq_printf(p, " %14s", irq_desc[i].handler->typename); seq_printf(p, " %14s", irq_desc[i].handler->typename);
seq_printf(p, " %s", action->name); seq_printf(p, " %s", action->name);
......
...@@ -508,9 +508,7 @@ ia64_mca_wakeup_all(void) ...@@ -508,9 +508,7 @@ ia64_mca_wakeup_all(void)
int cpu; int cpu;
/* Clear the Rendez checkin flag for all cpus */ /* Clear the Rendez checkin flag for all cpus */
for(cpu = 0; cpu < NR_CPUS; cpu++) { for_each_online_cpu(cpu) {
if (!cpu_online(cpu))
continue;
if (ia64_mc_info.imi_rendez_checkin[cpu] == IA64_MCA_RENDEZ_CHECKIN_DONE) if (ia64_mc_info.imi_rendez_checkin[cpu] == IA64_MCA_RENDEZ_CHECKIN_DONE)
ia64_mca_wakeup(cpu); ia64_mca_wakeup(cpu);
} }
......
...@@ -947,8 +947,8 @@ void ...@@ -947,8 +947,8 @@ void
percpu_modcopy (void *pcpudst, const void *src, unsigned long size) percpu_modcopy (void *pcpudst, const void *src, unsigned long size)
{ {
unsigned int i; unsigned int i;
for (i = 0; i < NR_CPUS; i++) for_each_cpu(i) {
if (cpu_possible(i)) memcpy(pcpudst + __per_cpu_offset[i], src, size);
memcpy(pcpudst + __per_cpu_offset[i], src, size); }
} }
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
...@@ -185,8 +185,8 @@ send_IPI_allbutself (int op) ...@@ -185,8 +185,8 @@ send_IPI_allbutself (int op)
{ {
unsigned int i; unsigned int i;
for (i = 0; i < NR_CPUS; i++) { for_each_online_cpu(i) {
if (cpu_online(i) && i != smp_processor_id()) if (i != smp_processor_id())
send_IPI_single(i, op); send_IPI_single(i, op);
} }
} }
...@@ -199,9 +199,9 @@ send_IPI_all (int op) ...@@ -199,9 +199,9 @@ send_IPI_all (int op)
{ {
int i; int i;
for (i = 0; i < NR_CPUS; i++) for_each_online_cpu(i) {
if (cpu_online(i)) send_IPI_single(i, op);
send_IPI_single(i, op); }
} }
/* /*
......
...@@ -694,9 +694,9 @@ smp_cpus_done (unsigned int dummy) ...@@ -694,9 +694,9 @@ smp_cpus_done (unsigned int dummy)
* Allow the user to impress friends. * Allow the user to impress friends.
*/ */
for (cpu = 0; cpu < NR_CPUS; cpu++) for_each_online_cpu(cpu) {
if (cpu_online(cpu)) bogosum += cpu_data(cpu)->loops_per_jiffy;
bogosum += cpu_data(cpu)->loops_per_jiffy; }
printk(KERN_INFO "Total of %d processors activated (%lu.%02lu BogoMIPS).\n", printk(KERN_INFO "Total of %d processors activated (%lu.%02lu BogoMIPS).\n",
(int)num_online_cpus(), bogosum/(500000/HZ), (bogosum/(5000/HZ))%100); (int)num_online_cpus(), bogosum/(500000/HZ), (bogosum/(5000/HZ))%100);
......
...@@ -77,9 +77,10 @@ wrap_mmu_context (struct mm_struct *mm) ...@@ -77,9 +77,10 @@ wrap_mmu_context (struct mm_struct *mm)
/* can't call flush_tlb_all() here because of race condition with O(1) scheduler [EF] */ /* can't call flush_tlb_all() here because of race condition with O(1) scheduler [EF] */
{ {
int cpu = get_cpu(); /* prevent preemption/migration */ int cpu = get_cpu(); /* prevent preemption/migration */
for (i = 0; i < NR_CPUS; ++i) for_each_online_cpu(i) {
if (cpu_online(i) && (i != cpu)) if (i != cpu)
per_cpu(ia64_need_tlb_flush, i) = 1; per_cpu(ia64_need_tlb_flush, i) = 1;
}
put_cpu(); put_cpu();
} }
local_flush_tlb_all(); local_flush_tlb_all();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment