VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / arch / ia64 / sn / kernel / sn2 / sn2_smp.c
index e8bc389..3ee7c10 100644 (file)
@@ -27,6 +27,7 @@
 #include <asm/delay.h>
 #include <asm/io.h>
 #include <asm/smp.h>
+#include <asm/tlb.h>
 #include <asm/numa.h>
 #include <asm/bitops.h>
 #include <asm/hw_irq.h>
@@ -60,6 +61,13 @@ wait_piowc(void)
 }
 
 
+void
+sn_tlb_migrate_finish(struct mm_struct *mm)
+{
+       if (mm == current->mm)
+               flush_tlb_mm(mm);
+}
+
 
 /**
  * sn2_global_tlb_purge - globally purge translation cache of virtual address range
@@ -114,6 +122,13 @@ sn2_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbit
                return;
        }
 
+       if (atomic_read(&mm->mm_users) == 1) {
+               flush_tlb_mm(mm);
+               preempt_enable();
+               return;
+       }
+
+
        nix = 0;
        for (cnode=find_first_bit(&nodes_flushed, NR_NODES); cnode < NR_NODES; 
                        cnode=find_next_bit(&nodes_flushed, NR_NODES, ++cnode))