Re: [RFC] configfs: module reference counting rules
From: Louis Rilling
Date: Mon Jun 16 2008 - 14:14:55 EST
On Mon, Jun 16, 2008 at 11:06:43AM -0700, Joel Becker wrote:
> > > Why can't mod_b provide a ->release() that does
> > > module_put(self)?
> >
> > Because this is simply wrong. Doing module_put(self) exposes the modules's
> > function to be run while another cpu unloads the module. Note how I solve this
>
> How so? As long as the module_put() is the last thing, you're
> fine. That said, we both have better solutions with our wrappered
> functions.
With a preemptible kernel, after module_put(self) the few assembly instructions
cleaning up the stack before returning to the caller can be called after the
memory allocated for the module has been freed. Which will make the kernel
crash.
Louis
--
Dr Louis Rilling Kerlabs
Skype: louis.rilling Batiment Germanium
Phone: (+33|0) 6 80 89 08 23 80 avenue des Buttes de Coesmes
http://www.kerlabs.com/ 35700 Rennes
Attachment:
signature.asc
Description: Digital signature