ARM: 6341/1: unwind - optimise linked-list searches for modules
authorPhil Carmody <ext-phil.2.carmody@nokia.com>
Thu, 19 Aug 2010 14:20:37 +0000 (15:20 +0100)
committerMatt Sealey <matt@genesi-usa.com>
Sat, 22 Jan 2011 04:11:31 +0000 (22:11 -0600)
commit6f7f785421af7a041b26424a268c105a67aef2f5
tree13385f1acc846a503051308126897949c9816a5a
parentc3346b907855d58274fe3b427d894a2a601c77c6
ARM: 6341/1: unwind - optimise linked-list searches for modules

With several sections per module, and dozens of modules, the
searches down the linked list of sections would dominate the
lookup time, dwarfing any savings from the binary search
within the section.

A simple move-to-front optimisation exploits the commonality
of the code paths taken, and in simple real-world tests reduces
the number of steps in the search to barely more than 1.

Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/unwind.c