diff options
| author | Ingo Molnar <mingo@elte.hu> | 2012-02-07 11:33:48 +0100 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2012-02-07 11:33:51 +0100 |
| commit | 7915a2e902df9fdb5ea5d5786a4172b38d0ea71e (patch) | |
| tree | 72b67d3079ffad2f5e21a5a449d210b355da13b6 /kernel/exit.c | |
| parent | 35f1790e6c6a7e4cae57b616cf36444d27fa6b28 (diff) | |
| parent | 23783f817bceedd6d4e549385e3f400ea64059e5 (diff) | |
Merge branch 'linus' into x86/boot
Merge this into x86/boot so that we can queue up dependent patches.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/exit.c')
| -rw-r--r-- | kernel/exit.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 294b1709170..4b4042f9bc6 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -1038,6 +1038,22 @@ void do_exit(long code) if (tsk->nr_dirtied) __this_cpu_add(dirty_throttle_leaks, tsk->nr_dirtied); exit_rcu(); + + /* + * The setting of TASK_RUNNING by try_to_wake_up() may be delayed + * when the following two conditions become true. + * - There is race condition of mmap_sem (It is acquired by + * exit_mm()), and + * - SMI occurs before setting TASK_RUNINNG. + * (or hypervisor of virtual machine switches to other guest) + * As a result, we may become TASK_RUNNING after becoming TASK_DEAD + * + * To avoid it, we have to wait for releasing tsk->pi_lock which + * is held by try_to_wake_up() + */ + smp_mb(); + raw_spin_unlock_wait(&tsk->pi_lock); + /* causes final put_task_struct in finish_task_switch(). */ tsk->state = TASK_DEAD; tsk->flags |= PF_NOFREEZE; /* tell freezer to ignore us */ |
