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

2017-05-15 Thread Davidlohr Bueso
On Thu, 20 Apr 2017, Peter Zijlstra wrote: For opt spinning we need to specifically know who would be next in order, again, doesn't matter how many, just who's next. I've sent a v3 with a more precise description of this, which I hope is to your satisfaction. Given a clear tree iteration/orde

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

2017-04-20 Thread Peter Zijlstra
On Thu, Apr 20, 2017 at 11:36:46AM -0700, Davidlohr Bueso wrote: > On Thu, 20 Apr 2017, Peter Zijlstra wrote: > >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. > > Yes, which is why I was thinking of ways t

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

2017-04-20 Thread Davidlohr Bueso
On Thu, 20 Apr 2017, Peter Zijlstra wrote: 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

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

2017-04-20 Thread Peter Zijlstra
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 tre

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

2017-04-20 Thread Davidlohr Bueso
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 plai

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

2017-04-19 Thread Peter Zijlstra
On Thu, Apr 06, 2017 at 01:46:14AM -0700, Davidlohr Bueso wrote: > ** What's still pending: > - Debug support (it's been a pain to use lockdep with range locking). How so? Just assume that every range is the full range. Which isn't such a weird assumption as it would seem. After all, you cannot

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

2017-04-06 Thread Davidlohr Bueso
Changes from v1 (https://lwn.net/Articles/716383/), all in patch 2: - s/EXPORT_SYMBOL/EXPORT_SYMBOL_GPL - Made the tree walks a foreach loop, instead of while. - Fixed signal_pending() lockup issue for unaccounted waiters. - Fixed initialization macros. - Check condition before signal_pen