public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: "Frank Ch. Eigler" <fche@redhat.com>
Cc: "K. Prasad" <prasad@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
	dipankar@in.ibm.com, ego@in.ibm.com,
	mathieu.desnoyers@polymtl.ca, paulmck@linux.vnet.ibm.com,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH 2/2] Markers Implementation for Preempt RCU Boost Tracing
Date: Wed, 2 Jan 2008 13:47:34 +0100	[thread overview]
Message-ID: <20080102124734.GC11208@elte.hu> (raw)
In-Reply-To: <y0modc4vr7a.fsf@ton.toronto.redhat.com>


* Frank Ch. Eigler <fche@redhat.com> wrote:

> Ingo Molnar <mingo@elte.hu> writes:
> 
> > [...]  Firstly, why on earth does a full format string have to be
> > passed in for something as simple as a CPU id? This way we basically
> > codify it forever that tracing _has_ to be expensive when
> > enabled. [...]
> 
> FWIW, I'm not keen about the format strings either, but they don't 
> constitute a performance hit beyond an additional parameter.  It does 
> not need to actually get parsed at run time.

"only" an additional parameter. The whole _point_ behind these markers 
is for them to have minimal effect!

> >[...]
> > Secondly, the inlined overhead of trace_mark() is still WAY too large:
> >
> >                 if (unlikely(__mark_##name.state)) {                    \
> > [...]
> >                 }                                                       \
> 
> Note that this is for the unoptimized case.  The immediate-value code 
> is better.  I have still yet to see some good measurements of how much 
> the overheads of the various variants are, however.  It's only fair to 
> gather these numbers and continue the debate with them in hand.

this is a general policy matter. It is _so much easier_ to add markers 
if they _can_ have near-zero overhead (as in 1-2 instructions). 
Otherwise we'll keep arguing about it, especially if any is added to 
performance-critical codepath. (where we are counting instructions)

> > Whatever became of the obvious suggestion that i outlined years ago, 
> > to have a _single_ trace call instruction and to _patch out_ the 
> > damn marker calls by default?  [...]  only leaving a ~5-byte NOP 
> > sequence behind them (and some minimal disturbance to the variables 
> > the tracepoint accesses). [...]
> 
> This has been answered several times before.  It's because the marker 
> parameters have to be (conditionally) evaluated and pushed onto a call 
> frame.  It's not just a call that would need being nop'd, but a whole 
> function call setup/teardown sequence, which itself can be interleaved 
> with adjacent code.

you are still missing my point. Firstly, the kernel is regparm built so 
there's no call frame to be pushed to in most cases - we pass most 
parameters in registers. (hence my stressing of minimizing the number of 
parameters to an absolute minimum)

Secondly, the side-effects of a function call is what i referred to via:

> [...]  (and some minimal disturbance to the variables the tracepoint 
> accesses). [...]

really, a tracepoint obviously accesses data that is readily accessible 
in that spot. Worst-case we'll have some additional register constraints 
that make the code a bit less optimal.

Yes, if a trace point references data that is _not_ readily available, 
then of course the preparation for the function call might not be cheap. 
But that can be optimized by placing the tracepoints intelligently.

what cannot be optimized away at all are the conditional instructions 
introduced by the probe points, extra parameters and the space overhead 
of the function call itself.

	Ingo

  reply	other threads:[~2008-01-02 12:49 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-31  6:09 [PATCH 2/2] Markers Implementation for Preempt RCU Boost Tracing K. Prasad
2007-12-31 10:20 ` Ingo Molnar
2008-01-02  3:31   ` Frank Ch. Eigler
2008-01-02 12:47     ` Ingo Molnar [this message]
2008-01-02 16:33       ` Frank Ch. Eigler
2008-01-02 17:01         ` Ingo Molnar
2008-01-02 17:56           ` Frank Ch. Eigler
2008-01-02 20:10             ` Ingo Molnar
2008-01-07 18:59           ` Mathieu Desnoyers
2008-01-13 18:07             ` Pavel Machek
2008-01-14 15:35               ` Mathieu Desnoyers
2008-01-14 16:30                 ` Linus Torvalds
2008-01-14 19:36                   ` Mathieu Desnoyers
2008-01-02 23:49         ` Nicholas Miell
2008-01-03 19:24   ` Mathieu Desnoyers
2008-01-03 16:30 ` Mathieu Desnoyers
2008-01-04 10:58   ` Gautham R Shenoy
2008-01-05 12:46     ` Mathieu Desnoyers
2008-01-07 19:43       ` K. Prasad
2008-01-07 19:50       ` [PATCH 0/2] Markers Implementation for RCU Tracing - Ver II K. Prasad
2008-02-18 12:21         ` Jan Kiszka
2008-02-18 12:47         ` Jan Kiszka
2008-02-18 19:48           ` Paul E. McKenney
2008-02-18 20:41             ` Mathieu Desnoyers
2008-02-19 16:27             ` Markers: multi-probe locking fun (was: Re: [PATCH 0/2] Markers Implementation for RCU Tracing - Ver II) Jan Kiszka
2008-02-19 20:33               ` Mathieu Desnoyers
2008-02-19 22:18                 ` Paul E. McKenney
2008-02-19 22:32                   ` Mathieu Desnoyers
2008-02-19 21:54               ` Paul E. McKenney
2008-02-19 22:03                 ` Mathieu Desnoyers
2008-02-19 22:19                   ` Paul E. McKenney
2008-01-07 19:55       ` [PATCH 1/2] Markers Implementation for RCU Preempt Tracing - Ver II K. Prasad
2008-01-07 19:56       ` [PATCH 2/2] Markers Implementation for Preempt RCU Boost " K. Prasad
2008-01-04 12:09   ` __get_cpu_var() called from a preempt-unsafe context in __rcu_preempt_unboost() ? Gautham R Shenoy
2008-01-04 13:48     ` Steven Rostedt
  -- strict thread matches above, loose matches on Subject: below --
2007-11-29 18:46 [PATCH 2/2] Markers Implementation for Preempt RCU Boost Tracing K. Prasad

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=20080102124734.GC11208@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=dipankar@in.ibm.com \
    --cc=ego@in.ibm.com \
    --cc=fche@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=prasad@linux.vnet.ibm.com \
    --cc=torvalds@linux-foundation.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