Re: [PATCH 3/5] locking/rwsem: Enable reader optimistic lock stealing

2020-12-07 Thread Davidlohr Bueso
On Tue, 17 Nov 2020, Waiman Long wrote: If the optimistic spinning queue is empty and the rwsem does not have the handoff or write-lock bits set, it is actually not necessary to call rwsem_optimistic_spin() to spin on it. Instead, it can steal the lock directly as its reader bias is in the

Re: [PATCH 3/5] locking/rwsem: Enable reader optimistic lock stealing

2020-11-20 Thread Waiman Long
On 11/20/20 9:36 AM, Peter Zijlstra wrote: On Tue, Nov 17, 2020 at 10:04:27PM -0500, Waiman Long wrote: diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c index ee374ae061c3..930dd4af3639 100644 --- a/kernel/locking/rwsem.c +++ b/kernel/locking/rwsem.c @@ -957,6 +957,12 @@ static

Re: [PATCH 3/5] locking/rwsem: Enable reader optimistic lock stealing

2020-11-20 Thread Peter Zijlstra
On Tue, Nov 17, 2020 at 10:04:27PM -0500, Waiman Long wrote: > diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c > index ee374ae061c3..930dd4af3639 100644 > --- a/kernel/locking/rwsem.c > +++ b/kernel/locking/rwsem.c > @@ -957,6 +957,12 @@ static inline bool

[PATCH 3/5] locking/rwsem: Enable reader optimistic lock stealing

2020-11-17 Thread Waiman Long
If the optimistic spinning queue is empty and the rwsem does not have the handoff or write-lock bits set, it is actually not necessary to call rwsem_optimistic_spin() to spin on it. Instead, it can steal the lock directly as its reader bias is in the count already. If it is the first reader in