Skip to content

Commit a53efe5

Browse files
author
Martin Schwidefsky
committed
sched/mm: call finish_arch_post_lock_switch in idle_task_exit and use_mm
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>
1 parent 56f15e5 commit a53efe5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

kernel/sched/core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4692,8 +4692,10 @@ void idle_task_exit(void)
46924692

46934693
BUG_ON(cpu_online(smp_processor_id()));
46944694

4695-
if (mm != &init_mm)
4695+
if (mm != &init_mm) {
46964696
switch_mm(mm, &init_mm, current);
4697+
finish_arch_post_lock_switch();
4698+
}
46974699
mmdrop(mm);
46984700
}
46994701

mm/mmu_context.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ void use_mm(struct mm_struct *mm)
3131
tsk->mm = mm;
3232
switch_mm(active_mm, mm, tsk);
3333
task_unlock(tsk);
34+
#ifdef finish_arch_post_lock_switch
35+
finish_arch_post_lock_switch();
36+
#endif
3437

3538
if (active_mm != mm)
3639
mmdrop(active_mm);

0 commit comments

Comments
 (0)