Wouldn't it make spinning more worthwhile the more CPUs you have running? The more other CPUs running, the more likely the lock will be released sooner than later, making the spinning instead of sleeping more likely to pay off, right?
Posted Jan 7, 2009 23:32 UTC (Wed) by jzbiciak (✭ supporter ✭, #5246)
[Link]
I don't know that it'd cause things to grind to a halt on a NUMA under normal circumstances. The cost of migrating lines goes up, sure, but you only get extra traffic when the busywaiter arrives just ahead of a lock-release.
I'm sure it could cause some interesting thundering-herd behavior, though, if there are a lot of people waiting on the lock to release though. If a large number of CPUs are in the busywaiting loop when the lock releases, things get really fun I suppose.