]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sched/mm: call finish_arch_post_lock_switch in idle_task_exit and use_mm
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 26 Oct 2012 15:17:44 +0000 (17:17 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 21 Feb 2014 07:50:17 +0000 (08:50 +0100)
The finish_arch_post_lock_switch is called at the end of the task
switch after all locks have been released. In concept it is paired
with the switch_mm function, but the current code only does the
call in finish_task_switch. Add the call to idle_task_exit and
use_mm. One use case for the additional calls is s390 which will
use finish_arch_post_lock_switch to wait for the completion of
TLB flush operations.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
kernel/sched/core.c
mm/mmu_context.c

index b46131ef6aab0ac48149482a03f8354330adf188..4b0739c9558e44437da19577fb4b0168fc34ea00 100644 (file)
@@ -4692,8 +4692,10 @@ void idle_task_exit(void)
 
        BUG_ON(cpu_online(smp_processor_id()));
 
-       if (mm != &init_mm)
+       if (mm != &init_mm) {
                switch_mm(mm, &init_mm, current);
+               finish_arch_post_lock_switch();
+       }
        mmdrop(mm);
 }
 
index 8a8cd0265e523b54909e456881a00d497fa456d3..f802c2d216a7d28bf76c5c911d83d10d213fd474 100644 (file)
@@ -31,6 +31,9 @@ void use_mm(struct mm_struct *mm)
        tsk->mm = mm;
        switch_mm(active_mm, mm, tsk);
        task_unlock(tsk);
+#ifdef finish_arch_post_lock_switch
+       finish_arch_post_lock_switch();
+#endif
 
        if (active_mm != mm)
                mmdrop(active_mm);