Commit:     d2ee7198cc2414aade234a3cebc69e6cbff35d9b
Parent:     7917ff9a4cefd0500aa4a1b1942da96dbce6999f
Author:     Oleg Nesterov <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 23:26:47 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Oct 17 08:42:51 2007 -0700

    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 <[EMAIL PROTECTED]>
    Acked-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 kernel/exit.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/exit.c b/kernel/exit.c
index 6ca1e46..3b8dfff 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -931,13 +931,13 @@ fastcall NORET_TYPE void do_exit(long code)
+       tsk->flags |= PF_EXITING;
         * tsk->flags are checked in the futex code to protect against
         * an exiting task cleaning up the robust pi futexes.
-       spin_lock_irq(&tsk->pi_lock);
-       tsk->flags |= PF_EXITING;
-       spin_unlock_irq(&tsk->pi_lock);
+       smp_mb();
+       spin_unlock_wait(&tsk->pi_lock);
        if (unlikely(in_atomic()))
                printk(KERN_INFO "note: %s[%d] exited with preempt_count %d\n",
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to