Re: [PATCH v2 -tip 0/6] locking: Introduce range reader/writer lock

From: Peter Zijlstra
Date: Thu Apr 20 2017 - 13:54:11 EST


On Thu, Apr 20, 2017 at 10:13:26AM -0700, Davidlohr Bueso wrote:

> I have thought of some heuristics for avoiding sleeping under certain
> constraints, which could mitigate the spinning step we loose, but I fear it
> will never be exactly as fast as rwsems -- just consider
> we always take the tree->lock.

But tree->lock is a spinlock, so while this gets us out of rwsem-xadd
territory for the fast paths, the whole lock-stealing and optimistic
spinning stuff is on a different scale.

Those are about avoiding actually going to sleep and having to be woken
up (and waiting to become running) again, which is a long time.