All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paulo Marques <pmarques@grupopie.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Alexey Dobriyan <adobriyan@sw.ru>,
	akpm@osdl.org, linux-kernel@vger.kernel.org, devel@openvz.org,
	tglx@linutronix.de, viro@zeniv.linux.org.uk,
	rusty@rustcorp.com.au
Subject: Re: [PATCH RESEND 2/2] Fix some kallsyms_lookup() vs rmmod races
Date: Fri, 16 Mar 2007 17:16:39 +0000	[thread overview]
Message-ID: <45FAD0F7.5090506@grupopie.com> (raw)
In-Reply-To: <20070316161853.GD9413@elte.hu>

Ingo Molnar wrote:
> * Paulo Marques <pmarques@grupopie.com> wrote:
> 
>>> looking at the problem from another angle: wouldnt this be something 
>>> that would benefit from freeze_processes()/unfreeze_processes(), and 
>>> hence no locking would be required?
>> I also considered this, but it seemed a little too "blunt" to stop 
>> everything (including completely unrelated processes and kernel 
>> threads) just to remove a module.
> 
> 'just to remove a module' is very, very rare, on the timescale of most 
> kernel ops. Almost no distro does it. Furthermore, because we want to do 
> CPU-hotplug that way, we really want to make 
> freeze_processes()/unfreeze_processes() 'instantaneous' to the human - 
> and it is that already. (if it isnt in some case we can make it so)

Ok. I started to look at this approach and realized that module.c 
already does this:

> ....
> static int __unlink_module(void *_mod)
> {
> 	struct module *mod = _mod;
> 	list_del(&mod->list);
> 	return 0;
> }
> 
> /* Free a module, remove from lists, etc (must hold module mutex). */
> static void free_module(struct module *mod)
> {
> 	/* Delete from various lists */
> 	stop_machine_run(__unlink_module, mod, NR_CPUS);
> ....

However stop_machine_run doesn't seem like the right thing to do, 
because users of the "modules" list don't seem to do anything to prevent 
preemption. Am I missing something?

Does freeze_processes() / unfreeze_processes() solve this by only 
freezing processes that have voluntarily scheduled (opposed to just 
being preempted)?

-- 
Paulo Marques - www.grupopie.com

"The Computer made me do it."

  reply	other threads:[~2007-03-16 17:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-16 11:44 [PATCH RESEND 2/2] Fix some kallsyms_lookup() vs rmmod races Alexey Dobriyan
2007-03-16 11:51 ` Ingo Molnar
2007-03-16 16:16   ` Paulo Marques
2007-03-16 16:18     ` Ingo Molnar
2007-03-16 17:16       ` Paulo Marques [this message]
2007-03-16 18:15         ` Andrew Morton
2007-03-16 20:27           ` Paulo Marques
2007-03-16 20:49             ` Andrew Morton
2007-03-17 10:36               ` Rusty Russell
2007-03-19  9:56             ` Alexey Dobriyan
2007-03-17  9:37   ` Rusty Russell
2007-03-19 10:21     ` Alexey Dobriyan
2007-03-19 15:17       ` Paulo Marques
2007-03-19 23:23       ` Rusty Russell
2007-03-17  9:32 ` Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45FAD0F7.5090506@grupopie.com \
    --to=pmarques@grupopie.com \
    --cc=adobriyan@sw.ru \
    --cc=akpm@osdl.org \
    --cc=devel@openvz.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.