[clug] Random Thought: support for Hot-code swap in the kernel

David Tulloh david at tulloh.id.au
Tue Jun 30 00:33:51 GMT 2009


jm wrote:
> What would it take to do hot-code swapping at the OS level in Linux?
>
> More fully, I was wondering what it would take to be able to have one 
> version of an application start up, inherit its state from another 
> version that is already running, have the old version shutdown and the 
> new version continue running without a noticable break in service.
>
> ...
>
> If it wasn't for the process state in kernel space it would just be a 
> matter of having a set of functions in the application which would 
> detect the presents of the new app, serialise the state, send the 
> state to the new app, etc. It's things like sockets, file descriptors, 
> etc which screw this idea up.
>
> ...

You can avoid most of the issues you raised by reversing the way you 
look at it.
The old version of the app bootstraps the new version, into the same 
process.

That way you don't change process id and retain all the same resources.

Another problem with doing this is that you will be changing state 
variables between versions.  So every version you release will have to 
have special conversion code from every previous version.

I suspect in the long run that you would be better off allowing two 
versions to be installed side by side and focusing on the tear down and 
setup time.  That would allow you to change versions very quickly but 
without hairy bootstrapping or ram copying.


David


More information about the linux mailing list