perf bench: Fix a couple of spelling mistakes in options text
[linux-2.6-microblaze.git] / kernel / kthread.c
index 1d9e2fd..b2807e7 100644 (file)
@@ -480,7 +480,6 @@ EXPORT_SYMBOL(kthread_bind);
  *          to "name.*%u". Code fills in cpu number.
  *
  * Description: This helper function creates and names a kernel thread
- * The thread will be woken and put into park mode.
  */
 struct task_struct *kthread_create_on_cpu(int (*threadfn)(void *data),
                                          void *data, unsigned int cpu,
@@ -1241,13 +1240,16 @@ void kthread_use_mm(struct mm_struct *mm)
        WARN_ON_ONCE(tsk->mm);
 
        task_lock(tsk);
+       /* Hold off tlb flush IPIs while switching mm's */
+       local_irq_disable();
        active_mm = tsk->active_mm;
        if (active_mm != mm) {
                mmgrab(mm);
                tsk->active_mm = mm;
        }
        tsk->mm = mm;
-       switch_mm(active_mm, mm, tsk);
+       switch_mm_irqs_off(active_mm, mm, tsk);
+       local_irq_enable();
        task_unlock(tsk);
 #ifdef finish_arch_post_lock_switch
        finish_arch_post_lock_switch();
@@ -1276,9 +1278,11 @@ void kthread_unuse_mm(struct mm_struct *mm)
 
        task_lock(tsk);
        sync_mm_rss(mm);
+       local_irq_disable();
        tsk->mm = NULL;
        /* active_mm is still 'mm' */
        enter_lazy_tlb(mm, tsk);
+       local_irq_enable();
        task_unlock(tsk);
 }
 EXPORT_SYMBOL_GPL(kthread_unuse_mm);