From: Nicolas Pitre <nico@cam.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: lkml <linux-kernel@vger.kernel.org>,
Arjan van de Ven <arjan@infradead.org>,
Russell King <rmk+lkml@arm.linux.org.uk>
Subject: Re: [patch 2/3] mutex subsystem: fastpath inlining
Date: Fri, 06 Jan 2006 16:20:42 -0500 (EST) [thread overview]
Message-ID: <Pine.LNX.4.64.0512291216330.3309@localhost.localdomain> (raw)
In-Reply-To: <20051229084100.GB31003@elte.hu>
Sorry for the delay...
On Thu, 29 Dec 2005, Ingo Molnar wrote:
>
> * Nicolas Pitre <nico@cam.org> wrote:
>
> > This is with all mutex patches applied and CONFIG_DEBUG_MUTEX_FULL=n,
> > therefore using the current semaphore code:
> >
> > text data bss dec hex filename
> > 1821108 287792 88264 2197164 2186ac vmlinux
> >
> > Now with CONFIG_DEBUG_MUTEX_FULL=y to substitute semaphores with
> > mutexes:
> >
> > text data bss dec hex filename
> > 1797108 287568 88172 2172848 2127b0 vmlinux
> >
> > Finally with CONFIG_DEBUG_MUTEX_FULL=y and fast paths inlined:
> >
> > text data bss dec hex filename
> > 1807824 287136 88172 2183132 214fdc vmlinux
> >
> > This last case is not the smallest, but it is the fastest.
>
> i.e. 1.3% text savings from going to mutexes, and inlining them again
> gives up 0.5% of that. We've uninlined stuff for a smaller gain in the
> past ...
>
> > > Note that x86 went to a non-inlined fastpath _despite_
> > > having a compact CISC semaphore fastpath.
> >
> > The function call overhead on x86 is less significant than the ARM
> > one, so always calling out of line code might be sensible in that
> > case.
>
> i'm highly doubtful we should do that. The spinlock APIs are 4 times
> more frequent than mutexes are ever going to be, still they too are
> mostly out of line. (and we only inline the unlock portions that are a
> space win!) Can you measure any significant difference in performance?
> (e.g. lat_pipe triggers the mutex fastpath, in DEBUG_MUTEX_FULL=y mode)
Here it is.
With the default non inlined fast path:
Pipe latency: 14.2669 microseconds
Pipe latency: 14.2625 microseconds
Pipe latency: 14.2655 microseconds
Pipe latency: 14.2670 microseconds
Then, with fast paths inlined:
Pipe latency: 13.9483 microseconds
Pipe latency: 13.9409 microseconds
Pipe latency: 13.9468 microseconds
Pipe latency: 13.9529 microseconds
So inlining the mutex fast path is more than 2% faster for the whole
test.
Is that worth the 0.5% increase in kernel size in your opinion?
Note: I modified lat_pipe to use two threads instead of two processes
since on ARM switching mm require a full cache flush due to the VIVT
cache, and doing so skyrockets the pipe latency up to 480 microsecs with
the mutex difference lost in the noise.
Nicolas
next prev parent reply other threads:[~2006-01-06 21:20 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-23 16:16 [patch 00/11] mutex subsystem, -V7 Ingo Molnar
2005-12-24 5:15 ` Nicolas Pitre
2005-12-24 5:23 ` Nicolas Pitre
2005-12-26 19:24 ` Nicolas Pitre
2005-12-26 19:25 ` [patch 1/3] mutex subsystem: trylock Nicolas Pitre
2005-12-27 11:51 ` Ingo Molnar
2005-12-27 20:47 ` Nicolas Pitre
2005-12-28 7:48 ` Ingo Molnar
2005-12-28 8:13 ` Ingo Molnar
2005-12-28 16:29 ` Nicolas Pitre
2005-12-28 17:09 ` Ingo Molnar
2005-12-27 12:05 ` Arjan van de Ven
2005-12-27 13:15 ` Ingo Molnar
2005-12-29 4:06 ` Nicolas Pitre
2005-12-29 8:33 ` Ingo Molnar
2005-12-29 9:01 ` Nick Piggin
2005-12-29 17:15 ` Nicolas Pitre
2005-12-30 2:05 ` Nick Piggin
2005-12-29 16:46 ` Nicolas Pitre
2005-12-29 3:22 ` Nicolas Pitre
2005-12-26 19:25 ` [patch 2/3] mutex subsystem: fastpath inlining Nicolas Pitre
2005-12-27 11:55 ` Ingo Molnar
2005-12-27 21:59 ` Nicolas Pitre
2005-12-28 7:41 ` Ingo Molnar
2005-12-29 2:53 ` Nicolas Pitre
2005-12-29 8:41 ` Ingo Molnar
2006-01-06 21:20 ` Nicolas Pitre [this message]
2005-12-26 19:26 ` [patch 3/3] mutex subsystem: inline mutex_is_locked() Nicolas Pitre
2005-12-27 11:37 ` 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=Pine.LNX.4.64.0512291216330.3309@localhost.localdomain \
--to=nico@cam.org \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rmk+lkml@arm.linux.org.uk \
/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
all inboxes | Powered by JetHome®