aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2007-10-17 02:26:47 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 11:42:51 -0400
commitd2ee7198cc2414aade234a3cebc69e6cbff35d9b (patch)
treee89d52b8b64f6eb675add025ba8507863e4bc0f8
parent7917ff9a4cefd0500aa4a1b1942da96dbce6999f (diff)
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: Oleg Nesterov <oleg@tv-sign.ru> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--kernel/exit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 6ca1e4666e9f..3b8dfffd9329 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -931,13 +931,13 @@ fastcall NORET_TYPE void do_exit(long code)
931 schedule(); 931 schedule();
932 } 932 }
933 933
934 tsk->flags |= PF_EXITING;
934 /* 935 /*
935 * tsk->flags are checked in the futex code to protect against 936 * tsk->flags are checked in the futex code to protect against
936 * an exiting task cleaning up the robust pi futexes. 937 * an exiting task cleaning up the robust pi futexes.
937 */ 938 */
938 spin_lock_irq(&tsk->pi_lock); 939 smp_mb();
939 tsk->flags |= PF_EXITING; 940 spin_unlock_wait(&tsk->pi_lock);
940 spin_unlock_irq(&tsk->pi_lock);
941 941
942 if (unlikely(in_atomic())) 942 if (unlikely(in_atomic()))
943 printk(KERN_INFO "note: %s[%d] exited with preempt_count %d\n", 943 printk(KERN_INFO "note: %s[%d] exited with preempt_count %d\n",