Re: Possible bug with mutex adaptative spinning

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Benjamin Herrenschmidt
Date: Tuesday, April 13, 2010 - 7:56 pm

On Wed, 2010-04-14 at 12:35 +1000, Benjamin Herrenschmidt wrote:

 .../...

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.

That sounds very wrong to me :-)

Shouldn't you at least remove the test for !owner when testing
need_resched() in __mutex_lock_common() ?

Cheers,
Ben.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Possible bug with mutex adaptative spinning, Benjamin Herrenschmidt, (Tue Apr 13, 7:35 pm)
Re: Possible bug with mutex adaptative spinning, Benjamin Herrenschmidt, (Tue Apr 13, 7:56 pm)
Re: Possible bug with mutex adaptative spinning, Peter Zijlstra, (Fri Apr 16, 2:26 pm)
Re: Possible bug with mutex adaptative spinning, Peter Zijlstra, (Fri Apr 16, 2:27 pm)
Re: Possible bug with mutex adaptative spinning, Benjamin Herrenschmidt, (Fri Apr 16, 3:00 pm)
Re: Possible bug with mutex adaptative spinning, Benjamin Herrenschmidt, (Fri Apr 16, 3:01 pm)
[tip:core/urgent] mutex: Don't spin when the owner CPU is ..., tip-bot for Benjamin ..., (Fri Apr 23, 3:49 am)