Skip to content

Commit

Permalink
ARM: 6341/1: unwind - optimise linked-list searches for modules
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Phil Carmody authored and Russell King committed Sep 2, 2010
1 parent 09e56a2 commit 5333a3d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/arm/kernel/unwind.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ static struct unwind_idx *unwind_find_idx(unsigned long addr)
addr < table->end_addr) {
idx = search_index(addr, table->start,
table->stop - 1);
/* Move-to-front to exploit common traces */
list_move(&table->list, &unwind_tables);
break;
}
}
Expand Down

0 comments on commit 5333a3d

Please sign in to comment.