diff options
author | Phil Carmody <ext-phil.2.carmody@nokia.com> | 2010-09-10 06:47:59 -0400 |
---|---|---|
committer | Kyle McMartin <kyle@mcmartin.ca> | 2010-10-21 21:12:19 -0400 |
commit | b1b1d4a6f244eb9513f006a188f7ed30d5014de5 (patch) | |
tree | 7fbdf118088f9d3746f384ea26312548ba5719dd /arch/parisc | |
parent | f720817700de48a57f54535a5dd9783cca2d2d6b (diff) |
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.c | 5 |
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) | |||
80 | if (addr >= table->start && | 80 | if (addr >= table->start && |
81 | addr <= table->end) | 81 | addr <= table->end) |
82 | e = find_unwind_entry_in_table(table, addr); | 82 | e = find_unwind_entry_in_table(table, addr); |
83 | if (e) | 83 | if (e) { |
84 | /* Move-to-front to exploit common traces */ | ||
85 | list_move(&table->list, &unwind_tables); | ||
84 | break; | 86 | break; |
87 | } | ||
85 | } | 88 | } |
86 | 89 | ||
87 | return e; | 90 | return e; |