lkml.org 
[lkml]   [2009]   [Jan]   [7]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateWed, 7 Jan 2009 08:25:30 -0800 (PST)
FromLinus Torvalds <>
SubjectRe: [PATCH -v4][RFC]: mutex: implement adaptive spinning

On Wed, 7 Jan 2009, Peter Zijlstra wrote:
>
> Change mutex contention behaviour such that it will sometimes busy wait on
> acquisition - moving its behaviour closer to that of spinlocks.

Ok, this one looks _almost_ ok.

The only problem is that I think you've lost the UP case. 

In UP, you shouldn't have the code to spin, and the "spin_or_schedule()" 
should fall back to just the schedule case.
It migth also be worthwhile to try to not set the owner, and re-organize 
that a bit (by making it a inline function that sets the owner only for 
CONFIG_SMP or lockdep/debug). 

			Linus


\
 
 \ /
  Last update: 2009-01-07 17:31    [from the cache]
©2003-2008