public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	systemtap@sourceware.org, jbeulich@novell.com,
	arjan <arjan@infradead.org>
Subject: Re: [RFC] systemtap: begin the process of using proper kernel APIs (part1: use kprobe symbol_name/offset instead of address)
Date: Fri, 18 Jul 2008 12:52:17 +0200	[thread overview]
Message-ID: <488075E1.7070306@firstfloor.org> (raw)
In-Reply-To: <1216377897.28405.6.camel@twins>

Peter Zijlstra wrote:
> On Fri, 2008-07-18 at 12:31 +0200, Andi Kleen wrote:
> 
>>> But while the x86 might not be perfect, its fairly ok these days. Its
>>> not the utter piece of shite x86_64 had for a long time 
>> Not sure what you're referring to with this. AFAIK the x86-64 unwinder
>> for a normal frame pointer less kernel was not any worse (or better)
>> than a i386 kernel without frame pointers.
> 
> I hardly ever compile a kernel without frame pointers, as debugability
> is top priority for me, so I'm afraid I'm not sure how bad it gets
> without.
> 
> But it used to be that x86_64 was crap even with frame pointers, and
> without it it was just random gibberish - Arjan fixed that up somewhere
> around .25 iirc.

Well yes it was designed for dwarf2 unwinding and Linus' revert of that
wrecked it. Also even the frame pointer walker was in the dwarf2
code, so with that removed it fell back to a somewhat dumb unwinder.

AFAIK most of the assembler code still doesn't set up frame pointers,
so you'll likely still run into problems.

> 
>> - today's traces
>>> mostly make sense.
>> If you enable frame pointers? Making your complete kernel slower?
>> Generating much worse code on i386 by wasting >20% of its available
>> registers?  Getting pipeline stalls on each function call/exit on many CPUs?
>>
>> Right now unfortunately there are a few rogue CONFIGs who select that
>> so more and more kernels have, but I found that always distateful because
>> enabling frame pointers has such a large impact on all kernel code, especially
>> on the register starved i386.
>>
>> I still think the right solution eventually is to have a dwarf2 unwinder
>> by default for i386/x86-64 and get rid of all these nasty "select
>> FRAME_POINTER"s which have unfortunately sneaked in.
> 
> No argument on i386 vs frame pointers, fortunately I hardly ever build a
> 32bit kernel these days, 32bit hardware is disappearing fast here :-) 

It hurts even on 64bit, e.g. the pipe line stall issue is there which
can be a significant part of a function call cost of a small function
of which the kernel has plenty (that was the major reason why the x86-64
ABI discouraged frame pointers BTW and encouraged unwinding). Given several
modern cores have special hardware to avoid that, but there's still a lot of the
older cores around and even on the modern cores it's not free.

Also it's ~10% of the registers there. And it has some other impact.

> As to merging the dwarf unwinder, I have no particular objection to
> getting that merged as I'm rather ignorant on these matters - but from
> reading emails around the last merge attempt, Linus had some strong
> opinions on the matter.
> 
> Have those been resolved since?

I added some checks back then to satisfy Linus. Also the dwarf2 unwinder
is shipping successfully for some time both in systemtap and in opensuse 11.0,
[although that one unfortunately fell victim to one of the rogue select
FRAME_POINTERs, sigh!] so there shouldn't be much teething problems left.

-Andi


  reply	other threads:[~2008-07-18 10:52 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-15 18:33 [RFC] systemtap: begin the process of using proper kernel APIs (part1: use kprobe symbol_name/offset instead of address) James Bottomley
2008-07-16 22:40 ` Masami Hiramatsu
2008-07-16 23:03   ` James Bottomley
2008-07-17  0:05     ` Masami Hiramatsu
2008-07-17  1:49       ` James Bottomley
2008-07-17 14:18         ` James Bottomley
2008-07-17 16:58           ` James Bottomley
2008-07-17 21:36             ` Masami Hiramatsu
2008-07-17 22:03               ` James Bottomley
2008-07-21 14:20               ` James Bottomley
     [not found]           ` <1216313914.5515.25.camel__21144.9282979176$1216314027$gmane$org@localhost.localdomain>
2008-07-17 18:30             ` Frank Ch. Eigler
2008-07-17 20:12               ` James Bottomley
2008-07-17 20:26                 ` Frank Ch. Eigler
2008-07-17 21:06                   ` James Bottomley
2008-07-17 21:33                     ` Frank Ch. Eigler
2008-07-17 22:03                       ` Masami Hiramatsu
2008-07-22 18:00                       ` Rik van Riel
2008-07-22 18:11                         ` Frank Ch. Eigler
2008-07-22 18:31                           ` Peter Zijlstra
     [not found]                           ` <1216751477.7257.115.camel__19834.5970632092$1216751567$gmane$org@twins>
2008-07-22 18:48                             ` Frank Ch. Eigler
2008-07-23 15:04                         ` systemtap & backward compatibility, was Re: [RFC] systemtap: begin the process of using proper kernel APIs Frank Ch. Eigler
2008-07-23 15:28                           ` Arjan van de Ven
2008-07-23 15:33                           ` Peter Zijlstra
2008-07-23 20:25                             ` Masami Hiramatsu
     [not found]                           ` <20080723082856.334f9c17__2909.60763018138$1216827051$gmane$org@infradead.org>
2008-07-23 16:41                             ` Frank Ch. Eigler
2008-07-23 16:54                               ` Adrian Bunk
2008-07-23 17:34                                 ` Frank Ch. Eigler
2008-07-23 18:40                                   ` Adrian Bunk
2008-07-23 22:12                               ` Masami Hiramatsu
2008-07-18  9:11 ` [RFC] systemtap: begin the process of using proper kernel APIs (part1: use kprobe symbol_name/offset instead of address) Andi Kleen
2008-07-18  9:23   ` Peter Zijlstra
2008-07-18 10:31     ` Andi Kleen
2008-07-18 10:44       ` Peter Zijlstra
2008-07-18 10:52         ` Andi Kleen [this message]
2008-07-18 13:02     ` Frank Ch. Eigler
2008-07-18 13:07       ` Andi Kleen
2008-07-18 13:10       ` Peter Zijlstra
2008-07-18 13:28         ` Frank Ch. Eigler
2008-07-18 13:35         ` Andi Kleen
2008-07-18 13:21       ` James Bottomley
2008-07-18 13:37         ` Frank Ch. Eigler
     [not found] <1216146802.3312.95.camel__45052.4692344063$1216146917$gmane$org@localhost.localdomain>
2008-07-15 19:41 ` Frank Ch. Eigler
2008-07-15 19:52   ` James Bottomley
2008-07-15 20:07     ` Frank Ch. Eigler
2008-07-15 20:24       ` James Bottomley
2008-07-15 22:18         ` Frank Ch. Eigler
2008-07-16  2:06           ` James Bottomley
2008-07-16 10:56             ` Frank Ch. Eigler
2008-07-16 14:56               ` James Bottomley

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=488075E1.7070306@firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=arjan@infradead.org \
    --cc=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=systemtap@sourceware.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