Re: [patch 5/9] mutex subsystem, core

From: Oleg Nesterov
Date: Thu Dec 22 2005 - 09:56:10 EST


Ingo Molnar wrote:
>
> > This is a minor issue, but still I think it makes sense to optimize
> > for uncontended case:
> >
> > old_val = atomic_xchg(&lock->count, 0); // no sleepers
> >
> > if (old_val == 1) {
> > // sleepers ?
> > if (!list_empty(&lock->wait_list))
> > // need to wakeup them
> > atomic_set(&lock->count, -1);
> > ...
> > }
> > [*]
>
> but then we'd have to set it to -1 again, at [*], because we are now

Oh! You are right, thanks.

Oleg.
-
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/