Re: [PATCH v2 5/5] locking/rwsem: Remove reader optimistic spinning

2020-12-08 Thread Waiman Long
On 12/8/20 5:07 AM, Peter Zijlstra wrote: On Fri, Nov 20, 2020 at 11:14:16PM -0500, Waiman Long wrote: @@ -1032,40 +901,16 @@ rwsem_down_read_slowpath(struct rw_semaphore *sem, int state, long count) * * We can take the read lock directly without doing *

Re: [PATCH v2 5/5] locking/rwsem: Remove reader optimistic spinning

2020-12-08 Thread Peter Zijlstra
On Fri, Nov 20, 2020 at 11:14:16PM -0500, Waiman Long wrote: > @@ -1032,40 +901,16 @@ rwsem_down_read_slowpath(struct rw_semaphore *sem, int > state, long count) >* >* We can take the read lock directly without doing >* rwsem_optimistic_spin() if the conditions are

Re: [PATCH v2 5/5] locking/rwsem: Remove reader optimistic spinning

2020-12-07 Thread Davidlohr Bueso
On Fri, 20 Nov 2020, Waiman Long wrote: Reader optimistic spinning is helpful when the reader critical section is short and there aren't that many readers around. It also improves the chance that a reader can get the lock as writer optimistic spinning disproportionally favors writers much more

[PATCH v2 5/5] locking/rwsem: Remove reader optimistic spinning

2020-11-20 Thread Waiman Long
Reader optimistic spinning is helpful when the reader critical section is short and there aren't that many readers around. It also improves the chance that a reader can get the lock as writer optimistic spinning disproportionally favors writers much more than readers. Since commit d3681e269fff