All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH RFC 1/2] qrwlock: A queue read/write lock implementation
@ 2013-07-18 12:55 George Spelvin
  2013-07-18 13:43 ` Waiman Long
  0 siblings, 1 reply; 45+ messages in thread
From: George Spelvin @ 2013-07-18 12:55 UTC (permalink / raw)
  To: Waiman.Long; +Cc: JBeulich, linix-kernel, linux, linux-arch, mingo, tglx

In the interest of more useful Kconfig help, could I recommend the
following text:

config QUEUE_RWLOCK
	bool "Generic queue read/write lock"
	depends on ARCH_QUEUE_RWLOCK
	help
	  Use an alternative reader-writer lock (rwlock) implementation,
	  optimized for larger NUMA systems.  These locks use more memory,
	  but perform better under high contention.  (Specifically, readers
	  waiting for a writer to release the lock will be queued rather
	  than all spinning on the same cache line.)

	  The kernel will operate correctly either way; this only
	  affects performance.

	  For common desktop and server systems systems with only one
	  or two CPU sockets, the performance benefits are not worth
	  the additional memory; say N here.

My goal is to give someone stumbling across this question for the first
time in "make oldconfig" the information htey need to answer it.


That said, I think Ingo's idea for simplfying the waiting reader side
is excellent and should be tried before bifurcating the implementation.

Looking at the lock system, it *seems* like that patch to __read_lock_failed
is literally the *only* thing that needs changing, since the write
lock/unlock is all done with relative add/sub anyway.  But I keep thinking
"there must have been a reason why it wasn't done that way in the first
place".

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: [PATCH RFC 1/2] qrwlock: A queue read/write lock implementation
@ 2013-07-18 13:18 George Spelvin
  0 siblings, 0 replies; 45+ messages in thread
From: George Spelvin @ 2013-07-18 13:18 UTC (permalink / raw)
  To: linux; +Cc: linux-kernel

In the interest of more useful Kconfig help, could I recommend the
following text:

config QUEUE_RWLOCK
	bool "Generic queue read/write lock"
	depends on ARCH_QUEUE_RWLOCK
	help
	  Use an alternative reader-writer lock (rwlock) implementation,
	  optimized for larger NUMA systems.  These locks use more memory,
	  but perform better under high contention.  (Specifically, readers
	  waiting for a writer to release the lock will be queued rather
	  than all spinning on the same cache line.)

	  The kernel will operate correctly either way; this only
	  affects performance.

	  For common desktop and server systems systems with only one
	  or two CPU sockets, the performance benefits are not worth
	  the additional memory; say N here.

My goal is to give someone stumbling across this question for the first
time in "make oldconfig" the information htey need to answer it.


That said, I think Ingo's idea for simplfying the waiting reader side
is excellent and should be tried before bifurcating the implementation.

Looking at the lock system, it *seems* like that patch to __read_lock_failed
is literally the *only* thing that needs changing, since the write
lock/unlock is all done with relative add/sub anyway.  But I keep thinking
"there must have been a reason why it wasn't done that way in the first
place".

^ permalink raw reply	[flat|nested] 45+ messages in thread
* [PATCH RFC 0/2] qrwlock: Introducing a queue read/write lock implementation
@ 2013-07-13  1:34 Waiman Long
  2013-07-13  1:34   ` Waiman Long
  0 siblings, 1 reply; 45+ messages in thread
From: Waiman Long @ 2013-07-13  1:34 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Arnd Bergmann
  Cc: Waiman Long, linux-arch, x86, linux-kernel, Peter Zijlstra,
	Steven Rostedt, Andrew Morton, Richard Weinberger,
	Catalin Marinas, Greg Kroah-Hartman, Matt Fleming, Herbert Xu,
	Akinobu Mita, Rusty Russell, Michel Lespinasse, Andi Kleen,
	Rik van Riel, Paul E. McKenney, Linus Torvalds,
	Chandramouleeswaran, Aswin, Norton, Scott J

This patch set introduces a queue-based read/write implementation that
is both faster and fairer than the current read/write lock. It can
also be used as a replacement for ticket spinlocks that are highly
contended if lock size increase is not an issue.

There is no change in the interface. By just replacing the current
read/write lock with the queue read/write lock, we can have a faster
and more deterministic system.

Signed-off-by: Waiman Long <Waiman.Long@hp.com>

Waiman Long (2):
  qrwlock: A queue read/write lock implementation
  x86 qrwlock: Enable x86 to use queue read/write lock

 arch/x86/Kconfig                      |    3 +
 arch/x86/include/asm/spinlock.h       |    2 +
 arch/x86/include/asm/spinlock_types.h |    4 +
 include/asm-generic/qrwlock.h         |  124 +++++++++++++++++
 lib/Kconfig                           |   11 ++
 lib/Makefile                          |    1 +
 lib/qrwlock.c                         |  246 +++++++++++++++++++++++++++++++++
 7 files changed, 391 insertions(+), 0 deletions(-)
 create mode 100644 include/asm-generic/qrwlock.h
 create mode 100644 lib/qrwlock.c


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

end of thread, other threads:[~2013-07-24  0:03 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-18 12:55 [PATCH RFC 1/2] qrwlock: A queue read/write lock implementation George Spelvin
2013-07-18 13:43 ` Waiman Long
2013-07-18 18:46   ` George Spelvin
2013-07-19 15:43     ` Waiman Long
2013-07-19 21:11       ` George Spelvin
2013-07-19 21:35         ` Waiman Long
  -- strict thread matches above, loose matches on Subject: below --
2013-07-18 13:18 George Spelvin
2013-07-13  1:34 [PATCH RFC 0/2] qrwlock: Introducing a " Waiman Long
2013-07-13  1:34 ` [PATCH RFC 1/2] qrwlock: A " Waiman Long
2013-07-13  1:34   ` Waiman Long
2013-07-15 14:39   ` Steven Rostedt
2013-07-15 14:39     ` Steven Rostedt
2013-07-15 20:44     ` Waiman Long
2013-07-15 20:44       ` Waiman Long
2013-07-15 22:31   ` Thomas Gleixner
2013-07-15 22:31     ` Thomas Gleixner
2013-07-16  1:19     ` Waiman Long
2013-07-16  1:19       ` Waiman Long
2013-07-18  7:42       ` Ingo Molnar
2013-07-18  7:42         ` Ingo Molnar
2013-07-18  7:42         ` Ingo Molnar
2013-07-18 13:40         ` Waiman Long
2013-07-18 13:40           ` Waiman Long
2013-07-18 13:40           ` Waiman Long
2013-07-19  8:40           ` Ingo Molnar
2013-07-19  8:40             ` Ingo Molnar
2013-07-19  8:40             ` Ingo Molnar
2013-07-19 15:30             ` Waiman Long
2013-07-19 15:30               ` Waiman Long
2013-07-19 15:30               ` Waiman Long
2013-07-22 10:34               ` Ingo Molnar
2013-07-22 10:34                 ` Ingo Molnar
2013-07-22 10:34                 ` Ingo Molnar
2013-07-24  0:03                 ` Waiman Long
2013-07-24  0:03                   ` Waiman Long
2013-07-24  0:03                   ` Waiman Long
2013-07-18 10:22       ` Thomas Gleixner
2013-07-18 10:22         ` Thomas Gleixner
2013-07-18 14:19         ` Waiman Long
2013-07-18 14:19           ` Waiman Long
2013-07-21  5:42           ` Raghavendra K T
2013-07-21  5:42             ` Raghavendra K T
2013-07-21  5:42             ` Raghavendra K T
2013-07-23 23:54             ` Waiman Long
2013-07-23 23:54               ` Waiman Long
2013-07-23 23:54               ` Waiman Long

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.