From: Ingo Molnar <mingo@elte.hu>
To: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
David Miller <davem@davemloft.net>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Roman Zippel <zippel@linux-m68k.org>,
linux-arch@vger.kernel.org,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Arnd Bergmann <arnd@arndb.de>,
Nick Piggin <nickpiggin@yahoo.com.au>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Horst Hartmann <horsth@linux.vnet.ibm.com>,
Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Subject: Re: [patch 0/8] Allow inlined spinlocks again V5
Date: Sat, 29 Aug 2009 16:13:54 +0200 [thread overview]
Message-ID: <20090829141354.GA29896@elte.hu> (raw)
In-Reply-To: <20090829135906.GA11215@osiris.boeblingen.de.ibm.com>
* Heiko Carstens <heiko.carstens@de.ibm.com> wrote:
> I assume you're talking of spin_unlock() and not spin_lock()?
yeah.
> It still gets inlined (spinlock.h):
>
> /*
> * We inline the unlock functions in the nondebug case:
> */
> #if defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) || \
> !defined(CONFIG_SMP)
> # define spin_unlock(lock) _spin_unlock(lock)
> [...]
> #else
> # define spin_unlock(lock) \
> do {__raw_spin_unlock(&(lock)->raw_lock); __release(lock); } while (0)
> [...]
>
> Or in other words, specifying __spin_lock_is_small causes only
> that the out-of-line variant doesn't get generated anymore. It
> gets inlined regardless (if config options allow).
>
> Now this could be simplified/cleanup by doing something like this:
>
> /*
> * We inline the unlock functions in the nondebug case:
> */
> #if defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) || \
> !defined(CONFIG_SMP)
> # define spin_unlock(lock) _spin_unlock(lock)
> [...]
> #else
> # define spin_unlock(lock) \
> do {__raw_spin_unlock(&(lock)->raw_lock); __release(lock); } while (0)
> [...]
>
> However it sucks a bit that we have two different ways to force
> inlining. So we could and probably should simplify this. The patch
> below (untested) would do that:
>
> ---
> include/linux/spinlock.h | 46 +++++----------------------------------
> include/linux/spinlock_api_smp.h | 12 ++++++++++
> 2 files changed, 18 insertions(+), 40 deletions(-)
Yes, that's exactly what i was thinking of. That way your patchset
becomes a cleanup as well, not just a 'touch a lot of dangerous
code' excercise in masochism ;-)
A third question would be, now that we have this flexible method to
inline/uninline locking APIs, mind checking say a 64-bit x86
defconfig and see whether that generic set of inline/noinline
decisions actually results in the smallest possible kernel image
size?
I.e. we could use this opportunity to re-tune the generic defaults.
(and thus your patch-set would become an improvement as well.)
Ingo
next prev parent reply other threads:[~2009-08-29 14:14 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-29 10:21 [patch 0/8] Allow inlined spinlocks again V5 Heiko Carstens
2009-08-29 10:21 ` Heiko Carstens
2009-08-29 10:21 ` [patch 1/8] powerpc: rename __spin_try_lock() and friends Heiko Carstens
2009-08-29 10:21 ` Heiko Carstens
2009-08-29 10:21 ` [patch 2/8] sparc: " Heiko Carstens
2009-08-29 10:21 ` Heiko Carstens
2009-08-29 22:27 ` David Miller
2009-08-29 10:21 ` [patch 3/8] m68k/asm-offsets: rename pt_regs offset defines Heiko Carstens
2009-08-29 10:21 ` Heiko Carstens
2009-08-29 10:21 ` [patch 4/8] m68k/asm-offsets: rename signal defines Heiko Carstens
2009-08-29 10:21 ` Heiko Carstens
2009-08-29 10:21 ` [patch 5/8] m68k: calculate thread_info offset with asm offset Heiko Carstens
2009-08-29 10:21 ` Heiko Carstens
2009-08-29 10:21 ` [patch 6/8] spinlock: move spinlock function bodies to header file Heiko Carstens
2009-08-29 10:21 ` Heiko Carstens
2009-08-29 10:21 ` [patch 7/8] spinlock: allow inlined spinlocks Heiko Carstens
2009-08-29 10:21 ` Heiko Carstens
2009-08-29 10:21 ` [patch 8/8] spinlock: inline code for all locking variants on s390 Heiko Carstens
2009-08-29 10:21 ` Heiko Carstens
2009-08-29 11:16 ` [patch 0/8] Allow inlined spinlocks again V5 Ingo Molnar
2009-08-29 13:59 ` Heiko Carstens
2009-08-29 14:13 ` Ingo Molnar [this message]
2009-08-31 8:59 ` Heiko Carstens
2009-09-01 13:19 ` Ingo Molnar
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=20090829141354.GA29896@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--cc=ehrhardt@linux.vnet.ibm.com \
--cc=geert@linux-m68k.org \
--cc=heiko.carstens@de.ibm.com \
--cc=horsth@linux.vnet.ibm.com \
--cc=linux-arch@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
--cc=paulus@samba.org \
--cc=schwidefsky@de.ibm.com \
--cc=torvalds@linux-foundation.org \
--cc=zippel@linux-m68k.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).