Skip to content

Commit

Permalink
parisc: unwind - optimise linked-list searches for modules
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Phil Carmody authored and Kyle McMartin committed Oct 22, 2010
1 parent f720817 commit b1b1d4a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/parisc/kernel/unwind.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b1b1d4a

Please sign in to comment.