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

From: Davidlohr Bueso
Date: Thu Apr 20 2017 - 13:13:46 EST


On Wed, 19 Apr 2017, Peter Zijlstra wrote:

- explain why the loss of lock stealing makes sense. IIRC walken added
that specifically to address mmap_sem performance issues.

That's right, and the same applies to the writer spinning stuff; which
can makes a huge difference - more so than plain stealing. But as I've
mentioned, range locks can improve parallelism, which is/should be much
more welcomed than optimizations to the primitive. So yeah, we loose in comparing a full range to rwsem (not to mention the xadd stuff).
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.

Thanks,
Davidlohr