Re: [PATCH] pi-futex: set PF_EXITING without taking ->pi_lock

From: Ingo Molnar
Date: Sat Jul 21 2007 - 08:33:21 EST



* Oleg Nesterov <oleg@xxxxxxxxxx> wrote:

> 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@xxxxxxxxxx>

Acked-by: Ingo Molnar <mingo@xxxxxxx>

> - spin_lock_irq(&tsk->pi_lock);
> - tsk->flags |= PF_EXITING;
> - spin_unlock_irq(&tsk->pi_lock);
> + smp_mb();
> + spin_unlock_wait(&tsk->pi_lock);

hm, isnt spin_unlock_wait() an SMP barrier in itself? (if not then it
should be.)

Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/