Re: [PATCH 03/11] jump label: Base patch for jump label

From: Rusty Russell
Date: Thu Sep 23 2010 - 20:45:00 EST


On Fri, 24 Sep 2010 04:10:06 am Jason Baron wrote:
> @@ -2749,8 +2750,10 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
> mod->symtab = mod->core_symtab;
> mod->strtab = mod->core_strtab;
> #endif
> - module_free(mod, mod->module_init);
> + init_code = mod->module_init;
> mod->module_init = NULL;
> + synchronize_rcu();
> + module_free(mod, init_code);
> mod->init_size = 0;
> mod->init_text_size = 0;
> mutex_unlock(&module_mutex);

When a patch requires more lkml mails than it has lines, it needs a comment.

But step back for a moment: what prompts the jump label update? Why isn't
that simply done under the module lock, obviating any complexity?

If you're frobbing kernel text all over the place, you probable want the
module lock. You wouldn't be the first: perhaps we should rename that to
kernel_text_lock...

Apologies if that's a dumb question,
Rusty.
--
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/