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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 [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]
  Powered by Linux