Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1422162

[RFC PATCH-tip 0/6] locking/rwsem: Enable reader optimistic spinning

From Waiman Long <Waiman.Long@hpe.com>
Newsgroups linux.kernel
Subject [RFC PATCH-tip 0/6] locking/rwsem: Enable reader optimistic spinning
Date 2016-06-14 20:20 +0200
Message-ID <rK16q-8sH-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


This patchset adds an option to enable more aggressive optimistic
spinning on both readers and writers waiting on a writer or reader
owned lock. Spinning on writer is done by looking at the on_cpu
flag of the lock owner. Spinning on readers, on the other hand, is
count-based as there is no easy way to figure out if all the readers
are running. The spinner will stop spinning once the count goes to
0. Because of that, spinning on readers may hurt performance in some
cases. So this feature is optional and has to explicitly enabled for
those rwsems where the readers are unlikely to go to sleep.

Patch 1 reduces the length of the blocking window after a read locking
attempt where writer lock stealing is disabled because of the active
read lock. It can improve rwsem performance for contended lock. It is
independent of the rest of the patchset.

Patches 2-5 lays the groundwork for enabling reader optimistic spinning.

Patch 6 enables reader optimistic spinning in XFS for inodes that
comes from a DAX-enabled mount point on top of persistent memory as
the CPUs can do I/O directly without waiting or sleeping.

Waiman Long (6):
  locking/rwsem: Stop active read lock ASAP
  locking/rwsem: Enable optional count-based spinning on reader
  locking/rwsem: move down rwsem_down_read_failed function
  locking/rwsem: Change RWSEM_WAITING_BIAS for better disambiguation
  locking/rwsem: Enable spinning readers
  xfs: Enable reader optimistic spinning for DAX inodes

 arch/alpha/include/asm/rwsem.h |    7 +-
 arch/ia64/include/asm/rwsem.h  |    6 +-
 arch/s390/include/asm/rwsem.h  |    6 +-
 arch/x86/include/asm/rwsem.h   |   13 ++-
 fs/xfs/xfs_icache.c            |    9 ++
 include/asm-generic/rwsem.h    |    9 +-
 include/linux/rwsem.h          |   21 ++++-
 kernel/locking/rwsem-xadd.c    |  212 ++++++++++++++++++++++++++--------------
 8 files changed, 192 insertions(+), 91 deletions(-)

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH-tip 0/6] locking/rwsem: Enable reader optimistic spinning Waiman Long <Waiman.Long@hpe.com> - 2016-06-14 20:20 +0200
  [RFC PATCH-tip 3/6] locking/rwsem: move down rwsem_down_read_failed function Waiman Long <Waiman.Long@hpe.com> - 2016-06-14 20:20 +0200
  [RFC PATCH-tip 5/6] locking/rwsem: Enable spinning readers Waiman Long <Waiman.Long@hpe.com> - 2016-06-14 20:20 +0200
  [RFC PATCH-tip 6/6] xfs: Enable reader optimistic spinning for DAX inodes Waiman Long <Waiman.Long@hpe.com> - 2016-06-14 20:20 +0200
    Re: [RFC PATCH-tip 6/6] xfs: Enable reader optimistic spinning for  DAX inodes Christoph Hellwig <hch@infradead.org> - 2016-06-14 20:30 +0200
    Re: [RFC PATCH-tip 6/6] xfs: Enable reader optimistic spinning for  DAX inodes Dave Chinner <david@fromorbit.com> - 2016-06-15 01:10 +0200
  [RFC PATCH-tip 2/6] locking/rwsem: Enable optional count-based spinning on reader Waiman Long <Waiman.Long@hpe.com> - 2016-06-14 20:20 +0200
    Re: [RFC PATCH-tip 2/6] locking/rwsem: Enable optional count-based  spinning on reader Davidlohr Bueso <dave@stgolabs.net> - 2016-06-14 20:30 +0200
  [RFC PATCH-tip 4/6] locking/rwsem: Change RWSEM_WAITING_BIAS for better disambiguation Waiman Long <Waiman.Long@hpe.com> - 2016-06-14 20:20 +0200
  [RFC PATCH-tip 1/6] locking/rwsem: Stop active read lock ASAP Waiman Long <Waiman.Long@hpe.com> - 2016-06-14 20:20 +0200

csiph-web