Re: [OKS] Module removal

Jamie Lokier
2002-07-08T00:31:06Z

Oliver Neukum wrote:
> How do you find CPU's that are about to execute module code ?
>
> IMHO you need to do this freeze trick before you check the module
> usage count.
>
> [..]
> > Another possibility would be the RCU thing: execute the module's exit
> > function, but keep the module's memory allocated until some safe
> > scheduling point later, when you are sure that no CPU can possibly be
> > running the module.
>
> But what do you do if that CPU increases the module usage count?

Those are the cases where I said this does not help.
You basically need:

(a) to catch the exiting case properly
(b) to catch entry points

Catching the entry points is what the current `try_inc_mod_count' code
does. I can't think of another way to do that.

-- Jamie