lkml.org 
[lkml]   [2003]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] Remove module reference counting.
Date
In message <1059172995.16255.6.camel@sherbert> you write:
> Wasn't the idea once banded about of a 2-stage unload that went
> something like:
>
> 1. ->cleanup() - unregister IRQ handlers, timers, etc.
> 2. Quiesce the system
> 3. Safe to unload
>
> surely if nothing is registered and all CPUs do a voluntary schedule()
> then there can be no chance of calling back in to the module.

Yes, I implemented this, even. The problem is that the desired module
semantics are "unload if it'll work, otherwise do nothing and fail".
This means that you either get halfway through the cleanup function
and back out (which leaves the race where some interfaces to your
module is MIA for a while), or you hang forever if things are in use.

It's this "atomically check refcount and deregister" that
try_module_get() gives us, by effectively unregistering all the
modules' interfaces at once.

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:47    [W:0.108 / U:27.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site