summaryrefslogtreecommitdiffstats
path: root/arch/parisc
diff options
context:
space:
mode:
authorPhil Carmody2010-09-10 12:47:59 +0200
committerKyle McMartin2010-10-22 03:12:19 +0200
commitb1b1d4a6f244eb9513f006a188f7ed30d5014de5 (patch)
tree7fbdf118088f9d3746f384ea26312548ba5719dd /arch/parisc
parentparisc: change to new flag variable (diff)
downloadkernel-qcow2-linux-b1b1d4a6f244eb9513f006a188f7ed30d5014de5.tar.gz
kernel-qcow2-linux-b1b1d4a6f244eb9513f006a188f7ed30d5014de5.tar.xz
kernel-qcow2-linux-b1b1d4a6f244eb9513f006a188f7ed30d5014de5.zip
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 <ext-phil.2.carmody@nokia.com> Signed-off-by: Kyle McMartin <kyle@redhat.com>
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/kernel/unwind.c5
1 files changed, 4 insertions, 1 deletions
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;