]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
parisc: unwind - optimise linked-list searches for modules
authorPhil Carmody <ext-phil.2.carmody@nokia.com>
Fri, 10 Sep 2010 10:47:59 +0000 (13:47 +0300)
committerKyle McMartin <kyle@mcmartin.ca>
Fri, 22 Oct 2010 01:12:19 +0000 (21:12 -0400)
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>
arch/parisc/kernel/unwind.c

index d58eac1a8288af9c07ef776faa9b29d6b1890a2e..76ed62ed785b6f4be9c1a6e663101ff3daeb6aa7 100644 (file)
@@ -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;