Re: [rfc] "fair" rw spinlocks

Nick Piggin
2009-11-30T07:57:41Z

On Sun, Nov 29, 2009 at 10:51:22AM -0800, Paul E. McKenney wrote:
> On Sat, Nov 28, 2009 at 09:30:18AM -0800, Linus Torvalds wrote:
> > So as far as I can tell, we have only one real user of rwlocks where
> > livelocks might be relevant, but that one real user absolutely _requires_
> > the unfair behavior.
>
> But the required unfairness is limited to unconditionally granting
> recursive read requests, right? If I understand correctly, if a given
> CPU does not already read-hold the lock, then we can safely make that
> CPU wait for a writer that might otherwise be starved. Again, is there
> another requirement that I am missing?

I think this is the only ordering requirement.