From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC] ARM: unwind: optimize to not convert each table value but the address
Date: Mon, 21 Nov 2011 16:34:00 +0000 [thread overview]
Message-ID: <20111121163359.GD3272@arm.com> (raw)
In-Reply-To: <1321830763-7227-1-git-send-email-u.kleine-koenig@pengutronix.de>
On Sun, Nov 20, 2011 at 11:12:42PM +0000, Uwe Kleine-K?nig wrote:
> The offsets in the unwind index section are signed 31 bit numbers and
> the structs are sorted by this offset. So it first has offsets between
> 0x40000000 and 0x7fffffff (i.e. the negative offsets) and then offsets
> between 0x00000000 and 0x3fffffff. When seperating these two blocks the
> numbers are sorted even when interpreting the offsets as unsigned longs.
>
> So instead of converting each offset hit during bisection to an absolute
> address, first determine which of the blocks needs to be searched and
> then adapt the key to find for the offset while bisecting using a simple
> unsigned long comparison.
>
> In my tests this is faster than the original implementation modifying
> the unwind index section by 4.5%.
If you don't care about the 7% unwinding performance drop on XIP
kernels, we could just have a prel31_lt() macro (or whatever other name)
which is a standard '<' comparison on !XIP kernels and does the prel31
conversion with XIP. It's only two places in search_index() where it is
needed and the code would still be more readable than the changes in
this patch :).
If you still want such improvement, I'll do a proper review of the
patch.
Thanks.
--
Catalin
next prev parent reply other threads:[~2011-11-21 16:34 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-17 13:40 [PATCH] ARM: fix unwinding for XIP kernels Uwe Kleine-König
2011-11-17 14:17 ` Catalin Marinas
2011-11-17 18:59 ` Uwe Kleine-König
2011-11-18 18:28 ` Nicolas Pitre
2011-11-18 21:36 ` Catalin Marinas
2011-11-20 11:28 ` Uwe Kleine-König
2011-11-20 22:52 ` Uwe Kleine-König
2011-11-20 23:12 ` [PATCH RFC] ARM: unwind: optimize to not convert each table value but the address Uwe Kleine-König
2011-11-21 16:34 ` Catalin Marinas [this message]
2011-11-21 18:16 ` Uwe Kleine-König
2011-11-30 17:58 ` Catalin Marinas
2011-11-30 19:07 ` [PATCH] ARM: fix unwinding for XIP kernels Uwe Kleine-König
2011-11-30 19:37 ` Nicolas Pitre
2011-11-30 19:52 ` Catalin Marinas
2011-11-21 18:35 ` Catalin Marinas
2011-11-28 9:22 ` Uwe Kleine-König
2011-11-28 9:45 ` Catalin Marinas
2011-11-28 10:02 ` Uwe Kleine-König
2011-11-28 10:07 ` Catalin Marinas
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=20111121163359.GD3272@arm.com \
--to=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).