lkml.org 
[lkml]   [2010]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Possible bug with mutex adaptative spinning
From
Date
On Wed, 2010-04-14 at 12:56 +1000, Benjamin Herrenschmidt wrote:
> On Wed, 2010-04-14 at 12:35 +1000, Benjamin Herrenschmidt wrote:
> > Hi Peter !
> >
> > I -may- have found a bug with mutex adaptative spinning. We hit it when
> > torture testing CPU unplug.
>
> .../...
>
> In fact, I wonder if there's another potential problem:
>
> If the owner is actually running, it may do so for a very long time. It
> looks to me that everybody trying to take the mutex will thus spin and
> never get out of the spin loop until the owner stops running.

The inner-most spin loop breaks out on need_resched():

if (task_thread_info(rq->curr) != owner || need_resched())
return 0;




\
 
 \ /
  Last update: 2010-04-16 23:29    [W:0.052 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site