lkml.org 
[lkml]   [2012]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 6/7] module: add two missing synchronize_sched()
From
Date
On Thu, 2012-03-15 at 22:49 +0800, Cong Wang wrote:
> In RCU doc, it said synchronize_sched() is used to mark the end
> of update, so two synchronize_sched() are missing after
> module list add/del.
>
> Cc: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> Cc: Rusty Russell <rusty@rustcorp.com.au>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> ---
> kernel/module.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/kernel/module.c b/kernel/module.c
> index 06e7dc5..2e7a5c5 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -1775,6 +1775,7 @@ static void free_module(struct module *mod)
> mutex_lock(&module_mutex);
> stop_machine(__unlink_module, mod, NULL);
> mutex_unlock(&module_mutex);
> + synchronize_sched();
> mod_sysfs_teardown(mod);
>
> /* Remove dynamic debug info */
> @@ -2928,6 +2929,7 @@ static struct module *load_module(void __user *umod,
> module_bug_finalize(info.hdr, info.sechdrs, mod);
> list_add_rcu(&mod->list, &modules);
> mutex_unlock(&module_mutex);
> + synchronize_sched();
>
> /* Module is ready to execute: parsing args may do that. */
> err = parse_args(mod->name, mod->args, mod->kp, mod->num_kp, NULL);

Have a look at stop_machine() first

after list_add_rcu(), there is absolutely no such requirement.





\
 
 \ /
  Last update: 2012-03-15 17:29    [from the cache]
©2003-2011 Jasper Spaans