Nick Piggin wrote: > > That would be interesting, yes. I have (somewhere) a patch > that wakes up the semaphore's waiters outside its spinlock. > I think that only gave about 5% or so improvement though. > > Here is a cleaned up patch for comments. It is untested at the moment because I don't have access to the 16-way NUMAQ now. It moves waking of the waiters outside the spinlock. I think it gave about 5-10% improvement when the rwsem gets really contended. Not as much as I had hoped, but every bit helps. The rwsem-spinlock.c code could use the same optimisation too.