aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/smp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel/smp.c')
-rw-r--r--arch/mips/kernel/smp.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index 481ba5355dcb..5ca3809a1b45 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -375,10 +375,13 @@ void flush_tlb_mm(struct mm_struct *mm)
375 if ((atomic_read(&mm->mm_users) != 1) || (current->mm != mm)) { 375 if ((atomic_read(&mm->mm_users) != 1) || (current->mm != mm)) {
376 smp_on_other_tlbs(flush_tlb_mm_ipi, (void *)mm); 376 smp_on_other_tlbs(flush_tlb_mm_ipi, (void *)mm);
377 } else { 377 } else {
378 int i; 378 cpumask_t mask = cpu_online_map;
379 for (i = 0; i < num_online_cpus(); i++) 379 unsigned int cpu;
380 if (smp_processor_id() != i) 380
381 cpu_context(i, mm) = 0; 381 cpu_clear(smp_processor_id(), mask);
382 for_each_online_cpu(cpu)
383 if (cpu_context(cpu, mm))
384 cpu_context(cpu, mm) = 0;
382 } 385 }
383 local_flush_tlb_mm(mm); 386 local_flush_tlb_mm(mm);
384 387
@@ -411,10 +414,13 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned l
411 fd.addr2 = end; 414 fd.addr2 = end;
412 smp_on_other_tlbs(flush_tlb_range_ipi, (void *)&fd); 415 smp_on_other_tlbs(flush_tlb_range_ipi, (void *)&fd);
413 } else { 416 } else {
414 int i; 417 cpumask_t mask = cpu_online_map;
415 for (i = 0; i < num_online_cpus(); i++) 418 unsigned int cpu;
416 if (smp_processor_id() != i) 419
417 cpu_context(i, mm) = 0; 420 cpu_clear(smp_processor_id(), mask);
421 for_each_online_cpu(cpu)
422 if (cpu_context(cpu, mm))
423 cpu_context(cpu, mm) = 0;
418 } 424 }
419 local_flush_tlb_range(vma, start, end); 425 local_flush_tlb_range(vma, start, end);
420 preempt_enable(); 426 preempt_enable();
@@ -453,10 +459,13 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
453 fd.addr1 = page; 459 fd.addr1 = page;
454 smp_on_other_tlbs(flush_tlb_page_ipi, (void *)&fd); 460 smp_on_other_tlbs(flush_tlb_page_ipi, (void *)&fd);
455 } else { 461 } else {
456 int i; 462 cpumask_t mask = cpu_online_map;
457 for (i = 0; i < num_online_cpus(); i++) 463 unsigned int cpu;
458 if (smp_processor_id() != i) 464
459 cpu_context(i, vma->vm_mm) = 0; 465 cpu_clear(smp_processor_id(), mask);
466 for_each_online_cpu(cpu)
467 if (cpu_context(cpu, vma->vm_mm))
468 cpu_context(cpu, vma->vm_mm) = 0;
460 } 469 }
461 local_flush_tlb_page(vma, page); 470 local_flush_tlb_page(vma, page);
462 preempt_enable(); 471 preempt_enable();