That's a good point. And yes I guess if that happens, then that will cause all other waiters to spin longer as well. Although I'm not sure that it is a problem in practice. The theory is that most of the time we have no contention, then FIFO locks are no worse than unfair locks. Actually we could have up to 1 process spinning on the lock, and NMI/IRQ delay behaviour shouldn't be any different than unfair locks. It is only when you start getting more contention that it could start to be a problem... But the heavily contended case often means performance has tanked anyway, and we are actually willing to sacrifice some performance to ensure fairness and forward progress. In short -- I'm hoping that the situation you ask about should not be a real problem. Unfortunately, as with a lot of these tricky interactions and uncommon workloads, it may be a release or two before we hear anything about it. But ticket locks are definitely something for kernel devs to keep in mind if investigating some unusual performance regression in future ;)
Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds