Re: freeing a static after one use only?

From: Tim Magill (tim@tengu.tmtrfl.tel.gte.com)
Date: Fri Feb 18 2000 - 19:22:29 EST


On Sat, Feb 19, 2000 at 12:50:29AM +0100, Peter T. Breuer wrote:
> "A month of sundays ago Tim Magill wrote:"
> > On Thu, Feb 17, 2000 at 11:54:46PM +0100, Peter T. Breuer wrote:
> > > use it once and then throw it away
> > >
> > Would it be possible to define the static data in its own loadable
> > module, that your driver could insmod and then rmmod?
>
> It's been suggested. I gave it a try just now, but got oopses.
> Possibly address space and/or unwanted optimization issues.
>
> And how do I load one module from another, then unload it?
>
> I settled for making the data module depend on the function module, but
> not vice versa. I then loaded the data module, which forced the
> function module to load first. The data module did its thing, and I
> would have unloaded it next, but it oopsed ...

  Again, I'm no expert, and I'm just guessing, but...

  It seems to me that data depending on function could have worked,
but how did you resolve the data addresses in the function module when
the function module is loaded before the data? Or is this what caused
the oops?

  Logically, the function module needs to depend on the data module,
but of course then you can't unload it. :(

  I think there are two possibilities. First there may be a way to
manually decrement the 'Used' count after you are done with the data
module. Then the module can be cleaned normally. Second, there may
be a way to manually insmod/rmmod the data module as if you were in
userland. That way there is no dependency between either of them.

tim

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



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:22 EST