From: Keith Owens <kaos@sgi.com>
To: William Lee Irwin III <wli@holomorphy.com>
Cc: Andrew Morton <akpm@osdl.org>,
Zwane Mwaikambo <zwane@linuxpower.ca>,
ak@suse.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][2.6] Allow x86_64 to reenable interrupts on contention
Date: Wed, 28 Jul 2004 11:48:05 +1000 [thread overview]
Message-ID: <2479.1090979285@kao2.melbourne.sgi.com> (raw)
In-Reply-To: Your message of "Tue, 27 Jul 2004 17:40:30 MST." <20040728004030.GK2334@holomorphy.com>
On Tue, 27 Jul 2004 17:40:30 -0700,
William Lee Irwin III <wli@holomorphy.com> wrote:
>It's good to know there is a precedent and that the backtrace issue has
>been looked at on other architectures.
>
>On Wed, Jul 28, 2004 at 10:35:08AM +1000, Keith Owens wrote:
>> Are you are planning to consolidate the out of line code for i386? Is
>> there a patch (even work in progress) so I can start thinking about
>> doing reliable backtraces?
>
>The experiments were carried out using the standard calling convention.
>We may investigate less standard calling conventions, but they should
>actually already be there given __write_lock_failed/__read_lock_failed.
>i.e. if reliable backtraces are going to be an issue they should
>already be an issue for rwlocks.
rwlocks are already a issue on i386, but not a big one. The return
address from __write_lock_failed/__read_lock_failed is pointing into
the out of line code, not the code that really took the rwlock. The
nearest label is LOCK_SECTION_NAME, i.e. .text.lock.KBUILD_BASENAME. A
backtrace through a contended rwlock on i386 looks like this
interrupt
__write_lock_failed/__read_lock_failed
.text.lock.KBUILD_BASENAME
caller of routine that took the lock
...
when it should really be
interrupt
__write_lock_failed/__read_lock_failed
.text.lock.KBUILD_BASENAME
routine that took the look <=== missing information
caller of routine that took the lock
...
IOW we only get the name of the object, not the function within the
object that took the lock. i386 gets away with this because
.text.lock.KBUILD_BASENAME is usually enough information to determine
which lock is the problem, and the i386 backtrace algorithm has enough
redundancy to get back in sync for the rest of the trace, even with the
missing function entry.
OTOH, ia64 unwind is incredibly sensitive to the exact instruction
pointer and there is zero redundancy in the unwind data. If the return
ip is not known to the unwind code, then the ia64 unwinder cannot
backtrace correctly. Which meant that I had to get the ia64 out of
line code exactly right, close enough was not good enough.
With Zwane's patch, any contended spinlock on i386 will look like
rwsem, it will be missing the routine that took the look. Good enough
for most cases.
kdb does unwind through out of line spinlock code exactly right, simply
because I added extra heuristics to kdb to cope with this special case.
When people complain that the kdb i386 backtrace code is too messy,
they are really saying that they do not care about getting exact data
for all the hand crafted assembler in the kernel.
BTW, if anybody is planning to switch to dwarf for debugging the i386
kernel then you _must_ have valid dwarf data for the out of line code.
next prev parent reply other threads:[~2004-07-28 1:49 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-27 9:29 [PATCH][2.6] Allow x86_64 to reenable interrupts on contention Zwane Mwaikambo
2004-07-27 11:26 ` Andi Kleen
2004-07-27 14:31 ` Zwane Mwaikambo
2004-07-27 15:37 ` Andi Kleen
2004-07-27 16:36 ` Ricky Beam
2004-07-28 8:47 ` Paul Jackson
2004-07-28 1:38 ` Zwane Mwaikambo
2004-07-27 19:01 ` Andrew Morton
2004-07-28 0:14 ` William Lee Irwin III
2004-07-28 0:35 ` Keith Owens
2004-07-28 0:40 ` William Lee Irwin III
2004-07-28 1:48 ` Keith Owens [this message]
2004-07-28 2:21 ` William Lee Irwin III
2004-07-28 2:24 ` David S. Miller
2004-07-28 8:20 ` William Lee Irwin III
2004-07-28 1:30 ` Zwane Mwaikambo
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=2479.1090979285@kao2.melbourne.sgi.com \
--to=kaos@sgi.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wli@holomorphy.com \
--cc=zwane@linuxpower.ca \
/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