linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] locking/rwsem: Rework reader optimistic spinning
@ 2020-11-18  3:04 Waiman Long
  2020-11-18  3:04 ` [PATCH 1/5] locking/rwsem: Pass the current atomic count to rwsem_down_read_slowpath() Waiman Long
                   ` (4 more replies)
  0 siblings, 5 replies; 23+ messages in thread
From: Waiman Long @ 2020-11-18  3:04 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Will Deacon
  Cc: linux-kernel, Davidlohr Bueso, Phil Auld, Waiman Long

A recent report of SAP certification failure caused by increased system
time due to rwsem reader optimistic spinning led me to reexamine the
code to see the pro and cons of doing it. This led me to discover a
potential lock starvation scenario as explained in patch 2. That patch
does reduce reader spinning to avoid this potential problem. Patches
3 and 4 are further optimizations of the current code.

Then there is the issue of reader fragmentation that can potentially
reduce performance in some heavy contention cases. Two different approaches
are attempted:
 1) further reduce reader optimistic spinning
 2) disable reader spinning

See the performance shown in patch 5.

This patch series adopts the second approach by dropping reader spinning
for now. We can discuss if this is the right move or we should try the
alternative or just don't do anything further.

Waiman Long (5):
  locking/rwsem: Pass the current atomic count to
    rwsem_down_read_slowpath()
  locking/rwsem: Prevent potential lock starvation
  locking/rwsem: Enable reader optimistic lock stealing
  locking/rwsem: Wake up all waiting readers if RWSEM_WAKE_READ_OWNED
  locking/rwsem: Remove reader optimistic spinning

 kernel/locking/lock_events_list.h |   6 +-
 kernel/locking/rwsem.c            | 277 ++++++++----------------------
 2 files changed, 73 insertions(+), 210 deletions(-)

-- 
2.18.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2020-12-08  4:19 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-18  3:04 [PATCH 0/5] locking/rwsem: Rework reader optimistic spinning Waiman Long
2020-11-18  3:04 ` [PATCH 1/5] locking/rwsem: Pass the current atomic count to rwsem_down_read_slowpath() Waiman Long
2020-11-18  3:04 ` [PATCH 2/5] locking/rwsem: Prevent potential lock starvation Waiman Long
2020-11-20 14:44   ` Peter Zijlstra
2020-11-20 17:27     ` Waiman Long
2020-11-18  3:04 ` [PATCH 3/5] locking/rwsem: Enable reader optimistic lock stealing Waiman Long
2020-11-20 14:36   ` Peter Zijlstra
2020-11-20 17:26     ` Waiman Long
2020-12-08  3:53   ` Davidlohr Bueso
2020-11-18  3:04 ` [PATCH 4/5] locking/rwsem: Wake up all waiting readers if RWSEM_WAKE_READ_OWNED Waiman Long
2020-11-18  4:53   ` Davidlohr Bueso
2020-11-19 18:37     ` Waiman Long
2020-11-18  3:04 ` [RFC PATCH 5/5] locking/rwsem: Remove reader optimistic spinning Waiman Long
2020-11-18  5:35   ` Davidlohr Bueso
2020-11-19 18:40     ` Waiman Long
2020-11-20 13:11       ` David Laight
2020-11-20 17:04         ` Waiman Long
2020-11-20 17:37           ` David Laight
2020-11-20 21:38         ` Davidlohr Bueso
2020-11-21 11:50           ` David Laight
2020-11-20 14:44     ` Peter Zijlstra
2020-11-20 22:39       ` Waiman Long
2020-11-20 14:42   ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).