Re: [PATCH-tip v2 06/12] locking/rwsem: Wake up almost all readers in wait queue

2019-04-10 Thread Waiman Long
On 04/10/2019 01:31 PM, Davidlohr Bueso wrote: > On Wed, 10 Apr 2019, Bueso wrote: > >> On Wed, 10 Apr 2019, Waiman Long wrote: >>> 2) I want to avoid the extreme case that there are more than 32k >>> readers >>> in the wait queue and make the count overflow. >> >> But in this case the readers are

Re: [PATCH-tip v2 06/12] locking/rwsem: Wake up almost all readers in wait queue

2019-04-10 Thread Waiman Long
On 04/10/2019 01:22 PM, Davidlohr Bueso wrote: > On Wed, 10 Apr 2019, Waiman Long wrote: >> There are 2 major reasons why there is a limit. >> >> 1) It will be unfair to the task that needs to spend so much of its own >> CPU time to wake up too many readers. > > This has never been a problem before

Re: [PATCH-tip v2 06/12] locking/rwsem: Wake up almost all readers in wait queue

2019-04-10 Thread Davidlohr Bueso
On Wed, 10 Apr 2019, Bueso wrote: On Wed, 10 Apr 2019, Waiman Long wrote: 2) I want to avoid the extreme case that there are more than 32k readers in the wait queue and make the count overflow. But in this case the readers are already on the queue. Never mind this. But the limit could stil

Re: [PATCH-tip v2 06/12] locking/rwsem: Wake up almost all readers in wait queue

2019-04-10 Thread Davidlohr Bueso
On Wed, 10 Apr 2019, Waiman Long wrote: There are 2 major reasons why there is a limit. 1) It will be unfair to the task that needs to spend so much of its own CPU time to wake up too many readers. This has never been a problem before. 2) I want to avoid the extreme case that there are more

Re: [PATCH-tip v2 06/12] locking/rwsem: Wake up almost all readers in wait queue

2019-04-10 Thread Waiman Long
On 04/10/2019 12:50 PM, Davidlohr Bueso wrote: > On Fri, 05 Apr 2019, 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 >> b

Re: [PATCH-tip v2 06/12] locking/rwsem: Wake up almost all readers in wait queue

2019-04-10 Thread Davidlohr Bueso
On Fri, 05 Apr 2019, 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 up. Because of optimisti

[PATCH-tip v2 06/12] locking/rwsem: Wake up almost all readers in wait queue

2019-04-05 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