* Oleg Nesterov <[email protected]> wrote:
> > + spin_lock(&lock->wait_lock);
> > + __add_waiter(lock, waiter, ti, task __IP__);
> > + set_task_state(task, task_state);
>
> I can't understand why __mutex_lock_common() does xchg() after adding
> the waiter to the ->wait_list. We are holding ->wait_lock, we can't
> race with __mutex_unlock_nonatomic() - it calls wake_up() and sets
> ->count under this spinlock.
we must make sure that the drop has not been dropped meanwhile, on the
way in, between the fastpath-unlock atomic op, and the xchg() here.
Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]