Re: [PATCH v4 10/16] locking/rwsem: Wake up almost all readers in wait queue

2019-04-17 Thread Waiman Long
On 04/17/2019 09:39 AM, Peter Zijlstra wrote: > On Sat, Apr 13, 2019 at 01:22:53PM -0400, Waiman Long wrote: >> When the front of the wait queue is a reader, other readers >> immediately following the first reader will also be woken up at the >> same time. However, if there is a writer in between.

Re: [PATCH v4 10/16] locking/rwsem: Wake up almost all readers in wait queue

2019-04-17 Thread Peter Zijlstra
On Sat, Apr 13, 2019 at 01:22:53PM -0400, Waiman Long wrote: > When the front of the wait queue is a reader, other readers > immediately following the first reader will also be woken up at the > same time. However, if there is a writer in between. Those readers > behind the writer will not be woken

Re: [PATCH v4 10/16] locking/rwsem: Wake up almost all readers in wait queue

2019-04-16 Thread Waiman Long
On 04/16/2019 12:50 PM, Davidlohr Bueso wrote: > On Sat, 13 Apr 2019, Waiman Long wrote: >> +/* >> + * We limit the maximum number of readers that can be woken up for a >> + * wake-up call to not penalizing the waking thread for spending too >> + * much time doing it. >> + */ >> +#define MAX_READER

Re: [PATCH v4 10/16] locking/rwsem: Wake up almost all readers in wait queue

2019-04-16 Thread Davidlohr Bueso
On Sat, 13 Apr 2019, Waiman Long wrote: +/* + * We limit the maximum number of readers that can be woken up for a + * wake-up call to not penalizing the waking thread for spending too + * much time doing it. + */ +#define MAX_READERS_WAKEUP 0x100 Although with wake_q this is not really so..

[PATCH v4 10/16] locking/rwsem: Wake up almost all readers in wait queue

2019-04-13 Thread Waiman Long
When the front of the wait queue is a reader, other readers immediately following the first reader will also be woken up at the same time. However, if there is a writer in between. Those readers behind the writer will not be woken up. Because of optimistic spinning, the lock acquisition order is n