Re: [PATCH 2/2] Replace the linear search with a binary search for locate the symbols

From: Andi Kleen
Date: Fri Mar 25 2011 - 15:49:53 EST


On Fri, Mar 25, 2011 at 05:30:11PM +0100, Alessio Igor Bogani wrote:
> Dear Mr. Kleen,
>
> 2011/3/25 Andi Kleen <andi@xxxxxxxxxxxxxx>:
> [...]
> >> > Patch looks good to me. SORT is a nice trick, too bad it won't
> >> > work for the main kernel.
> >>
> >> Why not?
> >
> > Because kallsyms is supposed to be in address order, not name order.
>
> What should that break exactly?
> Thanks you very much!

For kallsyms you either look it up by address or by name.
You can only sort for one of those.

Most likely address lookup is more important.

If you sorted by name you would make the address case slower.

Then the order is also exposed in /proc/kallsyms. If people use
this like System.map they likely expect numeric order.

-Andi
--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/