lkml.org 
[lkml]   [2015]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 4/6] locking/rwsem: Avoid deceiving lock spinners
From
Date
On Wed, 2015-01-28 at 17:10 -0800, Davidlohr Bueso wrote:

> if (READ_ONCE(sem->owner))
> return true; /* new owner, continue spinning */

In terms of the sem->owner check, I agree. This also reminds me of a
similar patch I was going to send out, but for mutex. The idea is that
before we added all the MCS logic, we wanted to return false if owner
isn't NULL to prevent too many threads simultaneously spinning on the
owner at the same time.

With the new MCS queuing, we don't have to worry about that issue, so it
makes sense to continue spinning as long as owner is running and the
spinner doesn't need to reschedule.




\
 
 \ /
  Last update: 2015-01-29 21:21    [W:0.068 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site