module: use list_add_tail_rcu() when adding module Put a new module at the end of the list given when we traverse the list with find_module_all() we look at the first entry first, if we're loading a series of modules chances are good what we look for can be in the front of the list. This is specially true if we somehow end up adding multiple module entries into the list, the fist one added should become live first than the ones added last. Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
diff --git a/kernel/module.c b/kernel/module.c index fed4c89..67df06e 100644 --- a/kernel/module.c +++ b/kernel/module.c
@@ -3652,7 +3652,7 @@ static int add_unformed_module(struct module *mod) goto out; } mod_update_bounds(mod); - list_add_rcu(&mod->list, &modules); + list_add_tail_rcu(&mod->list, &modules); mod_tree_insert(mod); err = 0;