[PATCH] Link new module to the tail of module list When we are linking/adding a new module, it would be better to insert the new module to the tail of the module list. The reason is when kallsyms_lookup_name(name) looks for the text address corresponding to the name from the head of the module list, we always hit the module exporting the text address first and then the module using the text address later. This helps kallsyms_lookup_name() search which indeed need the text address. Signed-off-by: Anil S Keshavamurthy ------------------------------------------------------------------- kernel/module.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletion(-) Index: linux-2.6.15-mm1/kernel/module.c =================================================================== --- linux-2.6.15-mm1.orig/kernel/module.c +++ linux-2.6.15-mm1/kernel/module.c @@ -1911,7 +1911,12 @@ static struct module *load_module(void _ static int __link_module(void *_mod) { struct module *mod = _mod; - list_add(&mod->list, &modules); + /* Insert the new modules at the tail of the list, + * so kallsyms_lookup_name finds the module exporting + * the text address of a function first and quickens + * the search when searching based on function name + */ + list_add_tail(&mod->list, &modules); return 0; } --