From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@elte.hu>,
linux-arch@vger.kernel.org,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Arnd Bergmann <arnd@arndb.de>,
Horst Hartmann <horsth@linux.vnet.ibm.com>,
Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>,
Nick Piggin <nickpiggin@yahoo.com.au>
Subject: Re: [patch 2/3] spinlock: allow inlined spinlocks
Date: Sun, 16 Aug 2009 19:57:50 +0200 [thread overview]
Message-ID: <20090816175750.GA5808@osiris.boeblingen.de.ibm.com> (raw)
In-Reply-To: <20090814125857.181021997@de.ibm.com>
Hi Linus, Andrew,
do you have any objections to the approach below?
Just wondering, since I didn't receive any comments.
On Fri, Aug 14, 2009 at 02:58:03PM +0200, Heiko Carstens wrote:
> From: Heiko Carstens <heiko.carstens@de.ibm.com>
>
> This allows an architecture to specify per lock variant if the
> locking code should be kept out-of-line or inlined.
>
> If an architecure wants out-of-line locking code no change is
> needed. To force inlining of e.g. spin_lock() the line
>
> #define __spin_lock_is_small
>
> needs to be added to arch/<whatever>/include/asm/spinlock.h
>
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
> ---
> include/linux/spinlock_api_smp.h | 146 ++++++++++++++++++++++++++++++++++++++-
> kernel/spinlock.c | 56 ++++++++++++++
> 2 files changed, 199 insertions(+), 3 deletions(-)
>
> Index: linux-2.6/include/linux/spinlock_api_smp.h
> ===================================================================
> --- linux-2.6.orig/include/linux/spinlock_api_smp.h
> +++ linux-2.6/include/linux/spinlock_api_smp.h
> @@ -19,46 +19,186 @@ int in_lock_functions(unsigned long addr
>
> #define assert_spin_locked(x) BUG_ON(!spin_is_locked(x))
>
> -void __lockfunc _spin_lock(spinlock_t *lock) __acquires(lock);
> void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass)
> __acquires(lock);
> void __lockfunc _spin_lock_nest_lock(spinlock_t *lock, struct lockdep_map *map)
> __acquires(lock);
> +unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass)
> + __acquires(lock);
> +
> +#ifdef __spin_lock_is_small
> +#define _spin_lock(lock) __spin_lock(lock)
> +#else
> +void __lockfunc _spin_lock(spinlock_t *lock) __acquires(lock);
> +#endif
...
> Index: linux-2.6/kernel/spinlock.c
> ===================================================================
> --- linux-2.6.orig/kernel/spinlock.c
> +++ linux-2.6/kernel/spinlock.c
...
> +#ifndef __spin_lock_is_small
> void __lockfunc _spin_lock(spinlock_t *lock)
> {
> __spin_lock(lock);
> }
> EXPORT_SYMBOL(_spin_lock);
> +#endif
next prev parent reply other threads:[~2009-08-16 17:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090816175750.GA5808@osiris.boeblingen.de.ibm.com \
--to=heiko.carstens@de.ibm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=ehrhardt@linux.vnet.ibm.com \
--cc=horsth@linux.vnet.ibm.com \
--cc=linux-arch@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=nickpiggin@yahoo.com.au \
--cc=schwidefsky@de.ibm.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).