Re: [patch 05/15] Generic Mutex Subsystem, mutex-core.patch

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

 



* Oleg Nesterov <[email protected]> wrote:

> > +__mutex_wakeup_waiter(struct mutex *lock __IP_DECL__)
> > +{
> > +	struct mutex_waiter *waiter;
> > ...
> > +	if (!waiter->woken) {
> > +		waiter->woken = 1;
> > +		wake_up_process(waiter->ti->task);
> > +	}
> 
> Is it optimization? If yes - why? From mutex.h:
> 
> 	- only one task can hold the mutex at a time
> 	- only the owner can unlock the mutex
> 
> So, how can this help?

yes, it's an optimization. I've removed it from the latest queue because 
it didnt trigger all that often, but the optimization is valid: while we 
have a 'waiter in flight', another (fast) task might grab the mutex, and 
might release it - in which case it could attempt to wake up the waiter 
again - which this flag optimizes.

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