public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicholas Miell <nmiell@comcast.net>
To: Mathieu Desnoyers <compudj@krystal.dyndns.org>
Cc: Martin Bligh <mbligh@google.com>,
	"Frank Ch. Eigler" <fche@redhat.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	prasanna@in.ibm.com, Andrew Morton <akpm@osdl.org>,
	Ingo Molnar <mingo@elte.hu>, Paul Mundt <lethal@linux-sh.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Jes Sorensen <jes@sgi.com>, Tom Zanussi <zanussi@us.ibm.com>,
	Richard J Moore <richardj_moore@uk.ibm.com>,
	Michel Dagenais <michel.dagenais@polymtl.ca>,
	Christoph Hellwig <hch@infradead.org>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	William Cohen <wcohen@redhat.com>,
	ltt-dev@shafik.org, systemtap@sources.redhat.com,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Jeremy Fitzhardinge <jeremy@goop.org>,
	Karim Yaghmour <karim@opersys.com>, Pavel Machek <pavel@suse.cz>,
	Joe Perches <joe@perches.com>,
	"Randy.Dunlap" <rdunlap@xenotime.net>,
	"Jose R. Santos" <jrs@us.ibm.com>
Subject: Re: Performance analysis of Linux Kernel Markers 0.20 for 2.6.17
Date: Sun, 01 Oct 2006 17:53:00 -0700	[thread overview]
Message-ID: <1159750380.2355.41.camel@entropy> (raw)
In-Reply-To: <20061002000731.GA22337@Krystal>

On Sun, 2006-10-01 at 20:07 -0400, Mathieu Desnoyers wrote:
> * Nicholas Miell (nmiell@comcast.net) wrote:
> > To summarize in chart form:
> > 
> >               JoC	JoCo	2NOP	1NOP
> > empty loop	1.17	2.50	0.50	2.50
> > memcpy	2.12	0.07	0.03	0.43
> > 
> > JoC 	= Jump over call - generic
> > JoCo	= Jump over call - optimized
> > 2NOP	= "data16 data16 nop; data16 nop"
> > 1NOP	= NOP with ModRM
> > 
> > I left out your "nop; lea 0(%esi), %esi" because it isn't actually a NOP
> > (the CPU will do actual work even if it has no effect, and on AMD64,
> > that insn is "nop; lea 0(%rdi), %esi", which will truncate RDI+0 to fit
> > 32-bits.)
> > 
> > The performance of NOP with ModRM doesn't suprise me -- AFAIK, only the
> > most recent of Intel CPUs actually special case that to be a true
> > no-work-done NOP.
> > 
> > It'd be nice to see the results of "jump to an out-of-line call with the
> > jump replaced by a NOP", but even if it performs well (and it should,
> > the argument passing and stack alignment overhead won't be executed in
> > the disabled probe case), actually using it in practice would be
> > difficult without compiler support (call instructions are easy to find
> > thanks to their relocations, which local jumps don't have).
> > 
> 
> Hi,
> 
> Just to make sure we see things the same way : the JoC approach is similar to
> the out-of-line call in that the argument passing and stack alignment are not
> executed when the probe is disabled.
> 

Yeah, I assumed that.

For the jump-over-call, you'll always have to do a test and a
conditional jump (even when the probe is disabled), and that test takes
work and that conditional jump will consume "useless" space in the
predictor cache.

For an unconditional-call-replaced-by-NOP, you'll always be doing the
work involved in the setup and cleanup for a function call, but there's
no conditional branching (which is a win, as your test results
demonstrate).

For the ideal case, you'd have a single unconditional jump to an
out-of-line function call, which you'd replace with a single NOP. No
unnecessary work (beyond the NOP instruction itself) gets done in the
disabled probe case, and in the enabled case, you don't have to do any
tests to see if the probe should be run. It should be an improvement all
around, if we could just get gcc to do the hard part of replacing the
unconditional jump with a NOP for us.

-- 
Nicholas Miell <nmiell@comcast.net>


  reply	other threads:[~2006-10-02  0:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-30 18:01 Performance analysis of Linux Kernel Markers 0.20 for 2.6.17 Mathieu Desnoyers
2006-09-30 19:02 ` Nicholas Miell
2006-10-01  3:42   ` Mathieu Desnoyers
2006-10-01  4:19     ` Nicholas Miell
2006-10-01 15:33       ` Mathieu Desnoyers
2006-10-01 23:57         ` Nicholas Miell
2006-10-02  0:07           ` Mathieu Desnoyers
2006-10-02  0:53             ` Nicholas Miell [this message]
2006-10-02 14:31 ` [UPDATE] " Mathieu Desnoyers
2006-10-02 15:24 ` Jose R. Santos
2006-10-02 15:38   ` Mathieu Desnoyers
2006-10-08 19:31 ` dean gaudet
2006-10-08 19:40   ` dean gaudet
2006-10-10 13:17   ` Mathieu Desnoyers

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=1159750380.2355.41.camel@entropy \
    --to=nmiell@comcast.net \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=compudj@krystal.dyndns.org \
    --cc=fche@redhat.com \
    --cc=gregkh@suse.de \
    --cc=hch@infradead.org \
    --cc=jeremy@goop.org \
    --cc=jes@sgi.com \
    --cc=joe@perches.com \
    --cc=jrs@us.ibm.com \
    --cc=karim@opersys.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ltt-dev@shafik.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mbligh@google.com \
    --cc=michel.dagenais@polymtl.ca \
    --cc=mingo@elte.hu \
    --cc=pavel@suse.cz \
    --cc=prasanna@in.ibm.com \
    --cc=rdunlap@xenotime.net \
    --cc=richardj_moore@uk.ibm.com \
    --cc=systemtap@sources.redhat.com \
    --cc=tglx@linutronix.de \
    --cc=wcohen@redhat.com \
    --cc=zanussi@us.ibm.com \
    /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