[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49E7D0BC.4070700@goop.org>
Date: Thu, 16 Apr 2009 17:43:40 -0700
From: Jeremy Fitzhardinge <jeremy@...p.org>
To: Mathieu Desnoyers <compudj@...stal.dyndns.org>
CC: Steven Rostedt <rostedt@...dmis.org>, linux-kernel@...r.kernel.org,
Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Theodore Tso <tytso@....edu>,
Arjan van de Ven <arjan@...radead.org>,
Christoph Hellwig <hch@....de>,
Lai Jiangshan <laijs@...fujitsu.com>,
Zhaolei <zhaolei@...fujitsu.com>, Li Zefan <lizf@...fujitsu.com>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Masami Hiramatsu <mhiramat@...hat.com>,
"Frank Ch. Eigler" <fche@...stic.org>,
Tom Zanussi <tzanussi@...il.com>,
Jiaying Zhang <jiayingz@...gle.com>,
Michael Rubin <mrubin@...gle.com>,
Martin Bligh <mbligh@...gle.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Neil Horman <nhorman@...driver.com>,
Eduard - Gabriel Munteanu <eduard.munteanu@...ux360.ro>,
Pekka Enberg <penberg@...helsinki.fi>
Subject: Re: [PATCH 2/8] tracing: create automated trace defines
Mathieu Desnoyers wrote:
> "all this code" is actually :
>
> rcu_read_lock_sched_notrace(); \
> it_func = rcu_dereference((tp)->funcs); \
> if (it_func) { \
> do { \
> ((void(*)(proto))(*it_func))(args); \
> } while (*(++it_func)); \
> } \
> rcu_read_unlock_sched_notrace(); \
>
> Which does nothing more than disabling preemption and a for loop to
> call all the tracepoint handlers. I don't see the big win in laying out
> the stack to call this code out-of-line; we would just remove the
> preempt disable and the loop, which are minimal compared to most
> call stacks.
>
Well, look at it from my perspective: Ingo has been repeatedly beating
me up for the overhead pvops adds to a native kernel, where it really is
just a (direct) function call. I want to instrument each pvop site with
a tracepoint so I can actually work out which calls are being called how
frequently to look for new optimisation opportunities.
I would guess the tracepoint code sequence is going to increase the
impact of each pvop call site by a fair bit, and that's not counting the
effects the extra register pressure will have. That's a pile of code to
add.
And frankly, that's fine by me, because I would expect this degree of
introspection to have some performance hit. But it does make the need
for per-subsystem tracing Kconfig entries fairly important, because I
don't think this would be acceptable to ship in a non-debug-everything
kernel build, even though other tracepoints might be.
> So basically, tracepoints are already just doing a function call, with a
> few more bytes for preempt disable and multiple handler support.
>
> About the compiler deciding to put the unlikely branch out-of-line, I've
> never seen any function calls generated just for the sake of saving
> those few bytes, that would be crazy of the part of the compiler.
> However, it can (and should) freely put the stack setup in the coldest
> cache-lines possible, which are reachable by a near jump.
>
No, it wouldn't generate a call. But if its going to put the code out
of line into cold cache-lines, then it may as well generate a call.
Anyway, the important point from my perspective is that tracepoint.h
have no #include dependencies beyond linux/types.h (compiler.h, etc).
J
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists