--- smp.c.old Thu Jul 29 13:06:18 1999 +++ SMP.C Thu Jul 29 13:55:41 1999 @@ -1617,6 +1617,8 @@ if (test_bit(cpu, &smp_invalidate_needed)) { clear_bit(cpu, &smp_invalidate_needed); local_flush_tlb(); + if(current->mm) + atomic_set_mask(1 << cpu, ¤t->mm->cpu_vm_mask); } --stuck; if (!stuck) { @@ -1637,14 +1639,16 @@ */ void flush_tlb_current_task(void) { - unsigned long vm_mask = 1 << current->processor; struct mm_struct *mm = current->mm; + unsigned long vm_mask = 1 << current->processor; + unsigned long cpu_mask = mm->cpu_vm_mask & ~vm_mask; - if (mm->cpu_vm_mask != vm_mask) { - flush_tlb_others(mm->cpu_vm_mask & ~vm_mask); + mm->cpu_vm_mask = 0; + if (current->active_mm == mm) { mm->cpu_vm_mask = vm_mask; + local_flush_tlb(); } - local_flush_tlb(); + flush_tlb_others(cpu_mask); } void flush_tlb_mm(struct mm_struct * mm)