Re: Efficient x86 and x86_64 NOP microbenchmarks

From: Andi Kleen
Date: Wed Aug 13 2008 - 16:14:36 EST


On Wed, Aug 13, 2008 at 04:00:37PM -0400, Steven Rostedt wrote:
> >Now the numbers have shown that just by not using frame pointer (
> >-pg right now implies frame pointer) you can get more benefit
> >than what you lose from using non optimal nops.
> >
>
> No, I can easily make a patch that does not use frame pointers but still

Not without patching gcc. Try it. The patch is not very difficult and i did
it here, but it needs a patch.

> If we disable frame pointers, the noprint-parent option would be forced.

Actually you can get the parent without frame pointer if you just
force gcc to emit mcount before touching the stack frame (and manual
insertion pass would do that). Then parent is at 4(%esp)/8(%rsp)
Again teaching gcc that is not very difficult, but it needs a patch.

> I would still require that the irqsoff tracer add frame pointers, just
> because knowing that the long latency of interrupts disabled happened at
> local_irq_save doesn't cut it ;-)

Nope.
>
> Anyway, who would want to run with frame pointers disabled? If you ever
> get a bug crash, the stack trace is pretty much useless.

First that's not true (remember most production kernels run
without frame pointers, also e.g. crash or systemtap know how to do proper
unwinding without slow frame pointers) and if you want it runtime also you
can always add the dwarf2 unwinder (like the opensuse kernel does) and get
better backtraces than you could ever get with frame pointers (that is
because e.g. most assembler code doesn't even bother to set up frame
pointers, but it is all dwarf2 annotated)

Also I must say the whole ftrace noping exercise is pretty pointless without
avoiding frame pointers because it does save less than what you lose
unconditionally from the "select FRAME_POINTER"

-Andi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/