[K42-discussion] question about K42 dynamic update feature
Andrew Baumann
andrewb at cse.unsw.edu.au
Thu Feb 8 09:20:24 EST 2007
Hi,
On Wednesday 07 February 2007 13:57, yanmiaobest wrote:
> I have a new implementation of some object to replace the old one. The
> old one is useless to me, incluing its data and functions. After hot-swap,
> the old version will never be used, so how do I clean up the obsolete
> functions in order to save memory. It seems none of your paper mentions
> that.
You're right, we don't support that at the moment. The data associated with an
object is always reclaimed, but the space used for code is not and leaks with
successive updates.
There are two problems here. First, if the object was part of the original
kernel image that was loaded, it is not easy to identify what part of the
kernel's text segment it belongs to, as that is all linked together at build
time. Second, if the object that has been replaced was already a dynamic
update, it should be possible to reclaim its memory just by unloading the
relevant module, but our module loader does not support this.
The second problem is solvable with a little bit more implementation work in
the module loader. The first problem is trickier, but I think could be
handled by stripping the number of objects in the base kernel down to the
bare minimum needed to boot, and then inserting the rest as loadable modules
(from a ram disk or similar) that could be removed again later as needed.
We haven't done any of this, because I think it isn't as interesting
research-wise, and other systems have already shown that you can build
smaller kernels and load much of the system as modules. Obviously, if you
were implementing a real system, you would need to address the memory leak,
but we haven't found it to be a problem in our experiments so far.
Good luck with your work, and feel free to ask me if you have more questions.
Regards,
Andrew
More information about the K42-discussion
mailing list