linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 0/3] Allow inlined spinlocks again V4
@ 2009-08-14 12:58 Heiko Carstens
  2009-08-14 12:58 ` [patch 1/3] spinlock: move spinlock function bodies to header file Heiko Carstens
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Heiko Carstens @ 2009-08-14 12:58 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Linus Torvalds, Peter Zijlstra, Ingo Molnar, linux-arch,
	Martin Schwidefsky, Heiko Carstens, Arnd Bergmann, Horst Hartmann,
	Christian Ehrhardt, Nick Piggin

This patch set allows to have inlined spinlocks again.

The rationale behind this is that function calls on at least s390 are
expensive.

If one considers that server kernels are usually compiled with
!CONFIG_PREEMPT a simple spin_lock is just a compare and swap loop.
The extra overhead for a function call is significant.
With inlined spinlocks overall cpu usage gets reduced by 1%-5% on s390.
These numbers were taken with some network benchmarks. However I expect
any workload that calls frequently into the kernel and which grabs a few
locks to perform better.

The implementation is straight forward: move the function bodies of the
locking functions to static inline functions and place them in a header
file.
By default all locking code remains out-of-line. An architecture can
specify

#define __spin_lock_is_small

in arch/<whatever>/include/asm/spinlock.h to force inlining of a locking
function.

V2: rewritten from scratch - now also with readable code

V3: removed macro to generate out-of-line spinlock variants since that
    would break ctags. As requested by Arnd Bergmann.

V4: allow architectures to specify for each lock/unlock variant if
    it should be kept out-of-line or inlined.

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [patch 0/3] Allow inlined spinlocks again V3
@ 2009-08-12 18:39 Heiko Carstens
  2009-08-12 18:39 ` [patch 2/3] spinlock: allow inlined spinlocks Heiko Carstens
  0 siblings, 1 reply; 17+ messages in thread
From: Heiko Carstens @ 2009-08-12 18:39 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Linus Torvalds, Peter Zijlstra, Ingo Molnar, linux-arch,
	Martin Schwidefsky, Heiko Carstens, Arnd Bergmann, Horst Hartmann,
	Christian Ehrhardt

Hi Andrew,

since there were no objections to this patch set, would you mind picking
it up for -mm? The patches are against current Linus' git head but also
apply on top of the latest mmotm patch set.

===

This patch set allows to have inlined spinlocks again.

The rationale behind this is that function calls on at least s390 are
expensive.

If one considers that server kernels are usually compiled with
!CONFIG_PREEMPT a simple spin_lock is just a compare and swap loop.
The extra overhead for a function call is significant.
With inlined spinlocks overall cpu usage gets reduced by 1%-5% on s390.
These numbers were taken with some network benchmarks. However I expect
any workload that calls frequently into the kernel and which grabs a few
locks to perform better.

The implementation is straight forward: move the function bodies of the
locking functions to static inline functions and place them in a header
file.
Dependent on CONFIG_SPINLOCK_INLINE generate out-of-line or inlined
locking functions.

The patches should be self explaining.

V2: rewritten from scratch - now also with readable code

V3: removed macro to generate out-of-line spinlock variants since that
    would break ctags. As requested by Arnd Bergmann.

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

end of thread, other threads:[~2009-08-17 15:46 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-14 12:58 [patch 0/3] Allow inlined spinlocks again V4 Heiko Carstens
2009-08-14 12:58 ` [patch 1/3] spinlock: move spinlock function bodies to header file Heiko Carstens
2009-08-14 12:58 ` [patch 2/3] spinlock: allow inlined spinlocks Heiko Carstens
2009-08-16 17:57   ` Heiko Carstens
2009-08-16 18:06     ` Ingo Molnar
2009-08-16 18:43       ` Linus Torvalds
2009-08-16 20:24         ` Ingo Molnar
2009-08-16 21:07           ` Linus Torvalds
2009-08-16 21:18             ` Ingo Molnar
2009-08-16 18:44       ` Heiko Carstens
2009-08-16 20:48         ` Ingo Molnar
2009-08-16 21:33           ` Heiko Carstens
2009-08-16 21:36             ` Ingo Molnar
2009-08-16 18:22     ` Linus Torvalds
2009-08-17 15:46       ` Heiko Carstens
2009-08-14 12:58 ` [patch 3/3] spinlock: inline code for all locking variants on s390 Heiko Carstens
  -- strict thread matches above, loose matches on Subject: below --
2009-08-12 18:39 [patch 0/3] Allow inlined spinlocks again V3 Heiko Carstens
2009-08-12 18:39 ` [patch 2/3] spinlock: allow inlined spinlocks Heiko Carstens

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).