Re: [RFC as402] Delaying module memory release

From: Alan Stern
Date: Wed Oct 27 2004 - 10:13:41 EST


On Wed, 27 Oct 2004, Rusty Russell wrote:

> On Tue, 2004-10-26 at 15:52 -0400, Alan Stern wrote:
> > This issue has come up in the past, without much in the way of visible
> > results.
> >
> > The problem is that sometimes the memory for a kernel module needs to be
> > freed _after_ rmmod has exited. The classic example is where the standard
> > input to the rmmod process has been redirected to a pseudo-file that pins
> > a kobject whose release method calls into the module. Another example
> > (which could be worked around with some effort) is multiple kernel threads
> > executing in the module -- the module exit routine would have to wait for
> > each one of them to terminate.
> >
> > In these cases it's not desirable/feasible to increment the module's
> > refcount.
>
> Why not? In the former the module is still in use, in the latter the
> module_exit routine is expected to clean up.

I have to apologize. Shortly after sending off the earlier email message,
I realized that the problem with sysfs pinning kobjects had already been
fixed by taking a reference to the attribute's owner module. The other
problem can be handled by other means. So my proposed change really is
not needed.

Consider the patch revoked.

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/