Re: Module Refcount & Stuff mini-FAQ
Rusty Russell (rusty@rustcorp.com.au)
Mon, 25 Nov 2002 11:26:25 +1100
In message <20021123222334.GB5170@elf.ucw.cz> you write:
> Hi!
>
> > Q: How does the module remove code work?
> > A: It stops the machine by scheduling threads for every other CPU,
> > then they all disable interrupts. At this stage we know that noone
> > is in try_module_get(), so we can reliably read the counter. If
> > zero, or the rmmod user specified --wait, we set the live flag to
> > false. After this, the reference count should not increase, and
> > each module_put() will wake us up, so we can check the counter
> > again.
>
> Where is this implemented? I guess I need this for swsusp...
I'm not so sure, but it's worth a look. Look for stop_refcounts() in
module.c. BTW, I call this a "bogolock".
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/