From: Andi Kleen <ak@suse.de>
To: Zwane Mwaikambo <zwane@linuxpower.ca>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org, mpm@selenic.com
Subject: Re: [PATCH][2.6] Completely out of line spinlocks / x86_64
Date: Mon, 9 Aug 2004 13:23:08 +0200 [thread overview]
Message-ID: <20040809132308.7312656b.ak@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.58.0408080156550.19619@montezuma.fsmlabs.com>
On Sun, 8 Aug 2004 02:08:30 -0400 (EDT)
Zwane Mwaikambo <zwane@linuxpower.ca> wrote:
> arch/x86_64/Kconfig | 10 ++++++++++
> arch/x86_64/lib/Makefile | 1 +
> arch/x86_64/lib/spinlock.c | 38 ++++++++++++++++++++++++++++++++++++++
> include/asm-x86_64/spinlock.h | 22 ++++++++++++++++++++--
> 4 files changed, 69 insertions(+), 2 deletions(-)
>
> Index: linux-2.6.8-rc3-mm1-amd64/arch/x86_64/Kconfig
> ===================================================================
> RCS file: /home/cvsroot/linux-2.6.8-rc3-mm1/arch/x86_64/Kconfig,v
> retrieving revision 1.1.1.1
> diff -u -p -B -r1.1.1.1 Kconfig
> --- linux-2.6.8-rc3-mm1-amd64/arch/x86_64/Kconfig 5 Aug 2004 16:37:48 -0000 1.1.1.1
> +++ linux-2.6.8-rc3-mm1-amd64/arch/x86_64/Kconfig 7 Aug 2004 22:47:30 -0000
> @@ -438,6 +438,16 @@ config DEBUG_SPINLOCK
> best used in conjunction with the NMI watchdog so that spinlock
> deadlocks are also debuggable.
>
> +config COOL_SPINLOCK
> + bool "Completely out of line spinlocks"
> + depends on SMP
> + default y
> + help
> + Say Y here to build spinlocks which have common text for contended
> + and uncontended paths. This reduces kernel text size by at least
> + 50k on most configurations, plus there is the additional benefit
> + of better cache utilisation.
I think the 50k number is wrong. I took a look at it and the big
difference is only seen when you enable interrupts during spinning, which
we didn't do before. If you compare it to the old implementation the
difference is much less.
I don't really like the config option. Either it's a good idea
then it should be done by default without option or it should not be done at all.
Did you do any lock intensive benchmarks that could show a slowdown?
> Index: linux-2.6.8-rc3-mm1-amd64/arch/x86_64/lib/spinlock.c
> ===================================================================
> RCS file: linux-2.6.8-rc3-mm1-amd64/arch/x86_64/lib/spinlock.c
> diff -N linux-2.6.8-rc3-mm1-amd64/arch/x86_64/lib/spinlock.c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ linux-2.6.8-rc3-mm1-amd64/arch/x86_64/lib/spinlock.c 8 Aug 2004 05:39:04 -0000
> @@ -0,0 +1,38 @@
> +#include <linux/module.h>
You should make this file assembly only.
-Andi
next prev parent reply other threads:[~2004-08-09 11:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-08 4:50 [PATCH][2.6] Completely out of line spinlocks / x86_64 Zwane Mwaikambo
2004-08-08 6:08 ` Zwane Mwaikambo
2004-08-09 11:23 ` Andi Kleen [this message]
2004-08-09 11:41 ` Marcelo Tosatti
2004-08-09 11:49 ` Marcelo Tosatti
2004-08-09 14:38 ` Matt Mackall
2004-08-09 21:31 ` Zwane Mwaikambo
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=20040809132308.7312656b.ak@suse.de \
--to=ak@suse.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
--cc=zwane@linuxpower.ca \
/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