Re: [RFC] Raceless module interface

From: Rusty Russell (rusty@rustcorp.com.au)
Date: Thu Sep 12 2002 - 08:03:18 EST


In message <Pine.LNX.4.44.0209121043160.28515-100000@serv> you write:
> Sigh, please let's analyze the complete problem first, before making any
> more kludges.
> Every (loaded) module is at least registered with two hooks in the kernel
> - the module structure and a driver structure (e.g. file_system_type for
> fs). During unloading we have to remove these hooks safely again.
> A module basically goes through these stages during its lifetime:
> 1. module load
> 2. module init
> 3. module exit
> 4. module unload
> The problem now is stage 3, as it's not allowed to fail. This means before

Nope, that's one of the two problems. Read my previous post: the
other is partial initialization.

Your patch is two-stage delete, with the additional of a usecount
function. So you have to move the usecount from the module to each
object it registers: great for filesystems, but I don't think it buys
you anything (since they were easy anyway).

Moreover, I don't see where your patch prevented someone increasing
the module count during try_unregister_module(), so that check is
pointless (do it in userspace unless they specify rmmod -f).

Alexey said we needed two-stage module delete back in 1999, so this is
not a new idea...

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/



This archive was generated by hypermail 2b29 : Sun Sep 15 2002 - 22:00:28 EST