Re: [PATCH 1/2] locking: Implement an algorithm choice for Wound-Wait mutexes

From: Thomas Hellstrom
Date: Fri Jun 15 2018 - 08:07:45 EST


On 06/14/2018 08:51 PM, Peter Zijlstra wrote:
On Thu, Jun 14, 2018 at 06:43:40PM +0200, Thomas Hellstrom wrote:
Overall, I think this looks fine. I'll just fix up the FLAG_WAITERS setting
and affected comments and do some torture testing on it.
Thanks!

Are you OK with adding the new feature and the cleanup in the same patch?
I suppose so, trying to untangle that will be a bit of a pain. But if
you feel so inclined I'm not going to stop you :-)

OK, I did some untangling. Sending out the resulting two patches. There are very minor changes in comments and naming, mostly trying to avoid "wound" where we really mean "die".

The only functional change is that I've moved the waiter-wounding-owner path to *after* we actually set the FLAG_WAITER so that we make sure a valid owner pointer remains valid while we hold the spinlock. This also means we can replace an smp_mb() with smp_mb__after_atomic().

Sending the patches as separate emails. Please let me know if you're OK with them and also the author / co-author info, and if so, I'll send out the full series again.

Thanks,

/Thomas