From: Phil Carmody Date: Fri, 10 Sep 2010 10:47:59 +0000 (+0300) Subject: parisc: unwind - optimise linked-list searches for modules X-Git-Tag: v2.6.37-rc1~69^2~4 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b1b1d4a6f244eb9513f006a188f7ed30d5014de5;p=karo-tx-linux.git parisc: unwind - optimise linked-list searches for modules Having many 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 on other architectures reduced the number of steps in the search to barely more than 1. Signed-off-by: Phil Carmody Signed-off-by: Kyle McMartin --- diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c index d58eac1a8288..76ed62ed785b 100644 --- a/arch/parisc/kernel/unwind.c +++ b/arch/parisc/kernel/unwind.c @@ -80,8 +80,11 @@ find_unwind_entry(unsigned long addr) if (addr >= table->start && addr <= table->end) e = find_unwind_entry_in_table(table, addr); - if (e) + if (e) { + /* Move-to-front to exploit common traces */ + list_move(&table->list, &unwind_tables); break; + } } return e;