* [PATCH, RESEND] pi-futex: set PF_EXITING without taking ->pi_lock
@ 2007-08-02 21:37 Oleg Nesterov
0 siblings, 0 replies; only message in thread
From: Oleg Nesterov @ 2007-08-02 21:37 UTC (permalink / raw)
To: Andrew Morton; +Cc: Ingo Molnar, linux-kernel
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>
--- t/kernel/exit.c~PF_EXIT 2007-06-19 17:09:15.000000000 +0400
+++ t/kernel/exit.c 2007-07-21 15:34:13.000000000 +0400
@@ -908,13 +908,13 @@ fastcall NORET_TYPE void do_exit(long co
schedule();
}
+ 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",
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-08-02 21:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-02 21:37 [PATCH, RESEND] pi-futex: set PF_EXITING without taking ->pi_lock Oleg Nesterov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®