This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [RFC][ PATCH -tip v2 0/7] kprobes: Kprobes jump optimization support
- From: Andi Kleen <andi at firstfloor dot org>
- To: Masami Hiramatsu <mhiramat at redhat dot com>
- Cc: Ingo Molnar <mingo at elte dot hu>, Ananth N Mavinakayanahalli <ananth at in dot ibm dot com>, lkml<linux-kernel at vger dot kernel dot org>, "H. Peter Anvin" <hpa at zytor dot com>, Frederic Weisbecker <fweisbec at gmail dot com>, Jim Keniston <jkenisto at us dot ibm dot com>, Srikar Dronamraju <srikar at linux dot vnet dot ibm dot com>, Christoph Hellwig <hch at infradead dot org>, Steven Rostedt <rostedt at goodmis dot org>, Anders Kaseorg <andersk at ksplice dot com>, Tim Abbott <tabbott at ksplice dot com>, systemtap<systemtap at sources dot redhat dot com>, DLE<dle-develop at lists dot sourceforge dot net>
- Date: Tue, 23 Jun 2009 14:09:24 +0200
- Subject: Re: [RFC][ PATCH -tip v2 0/7] kprobes: Kprobes jump optimization support
- References: <20090622212255.5384.53732.stgit@localhost.localdomain>
Masami Hiramatsu <mhiramat@redhat.com> writes:
>
> The gcc's crossjumping unifies equivalent code by inserting indirect
> jumps which jump into other function body. It is hard to know to where
> these jumps jump, so I decided to disable it when setting
> CONFIG_OPTPROBES=y.
That sounds quite bad. Tail call optimization is an important optimization
that especially on kernel style code (lots of indirect pointers
and sometimes deep call chains) is very useful. It would be quite
sad if production kernels would lose that optimization.
Also tail calls in C should always jump directly to another function,
so they shouldn't be particularly complex to manage.
> I also decided not to optimize probes when it is in functions which
> will cause exceptions, because the exception in the kernel will jump
> to a fixup code and the fixup code jumps back to the middle of the
> same function body.
Note that not only exceptions do that, there are a few other cases
where jumps in and out of out of line sections happen. You might
need a more general mechanism to detect this.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.