From: Phil Carmody Date: Thu, 19 Aug 2010 14:20:37 +0000 (+0100) Subject: ARM: 6341/1: unwind - optimise linked-list searches for modules X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5333a3de3cdd739ec4f6d501f5f6d09bab7ff919;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git 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 Acked-by: Catalin Marinas Signed-off-by: Russell King --- diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c index dd81a918c106..2a161765f6d5 100644 --- a/arch/arm/kernel/unwind.c +++ b/arch/arm/kernel/unwind.c @@ -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; } }