Messages in this thread | | | Subject | Re: [PATCH 4/6] locking/rwsem: Avoid deceiving lock spinners | From | Jason Low <> | Date | Thu, 29 Jan 2015 12:13:21 -0800 |
| |
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.
| |