lkml.org 
[lkml]   [2002]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Module Refcount & Stuff mini-FAQ
Date
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/

\
 
 \ /
  Last update: 2005-03-22 13:31    [W:0.318 / U:0.392 seconds]
©2003-2014 Jasper Spaans. Advertise on this site