提交 d2ee7198 编写于 作者: O Oleg Nesterov 提交者: Linus Torvalds

pi-futex: set PF_EXITING without taking ->pi_lock

It is a bit annoying that do_exit() takes ->pi_lock to set PF_EXITING.  All
we need is to synchronize with lookup_pi_state() which saw this task
without PF_EXITING under ->pi_lock.

Change do_exit() to use spin_unlock_wait().
Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
Acked-by: NIngo Molnar <mingo@elte.hu>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 7917ff9a
...@@ -931,13 +931,13 @@ fastcall NORET_TYPE void do_exit(long code) ...@@ -931,13 +931,13 @@ fastcall NORET_TYPE void do_exit(long code)
schedule(); schedule();
} }
tsk->flags |= PF_EXITING;
/* /*
* tsk->flags are checked in the futex code to protect against * tsk->flags are checked in the futex code to protect against
* an exiting task cleaning up the robust pi futexes. * an exiting task cleaning up the robust pi futexes.
*/ */
spin_lock_irq(&tsk->pi_lock); smp_mb();
tsk->flags |= PF_EXITING; spin_unlock_wait(&tsk->pi_lock);
spin_unlock_irq(&tsk->pi_lock);
if (unlikely(in_atomic())) if (unlikely(in_atomic()))
printk(KERN_INFO "note: %s[%d] exited with preempt_count %d\n", printk(KERN_INFO "note: %s[%d] exited with preempt_count %d\n",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册