public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: Andi Kleen <ak@suse.de>
Cc: Zwane Mwaikambo <zwane@linuxpower.ca>,
	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 08:49:12 -0300	[thread overview]
Message-ID: <20040809114912.GA5287@logos.cnet> (raw)
In-Reply-To: <20040809114138.GB5191@logos.cnet>

On Mon, Aug 09, 2004 at 08:41:38AM -0300, Marcelo Tosatti wrote:
> On Mon, Aug 09, 2004 at 01:23:08PM +0200, Andi Kleen wrote:
> > 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?
> 
> Out of curiosity, also, have you ran any lock intensive benchmarks to get some
> numbers out of the increased cacheline hits due to uninlining? 
> 
> I think you can measure the hits/misses precisely with Mikael's perfcounters.

Hi Zwane, 

Just seen your bonnie++ results (should have the whole thread before replying), 
looks great, except a slight reduction in sequential output:

out-of-line spinlocks:
Version  @version@      ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
stp2-000         2G  7018  99 64560  36 21694  16  6789  97 43729  14 340.6   1
stp2-000         2G  7055  99 64836  39 21899  16  6752  97 44827  17 330.8   2
stp2-000         2G  7023  99 64525  38 22987  17  6704  96 44777  14 337.3   1

mainline:
Version  @version@      ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
stp2-000         2G  7048  99 64912  38 22510  17  6732  96 43900  14 332.0   1
stp2-000         2G  7018  99 63821  39 21732  16  6787  97 44889  17 326.7   2
stp2-000         2G  7063  99 63834  38 22361  17  6738  97 43310  14 338.3   1
                    ------Sequential Create------ --------Random Create--------

Probably just noise, still I think its worth mentioning.


  reply	other threads:[~2004-08-09 13:55 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
2004-08-09 11:41     ` Marcelo Tosatti
2004-08-09 11:49       ` Marcelo Tosatti [this message]
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=20040809114912.GA5287@logos.cnet \
    --to=marcelo.tosatti@cyclades.com \
    --cc=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