lkml.org 
[lkml]   [1996]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Core dumps & restarting
On Tue, 29 Oct 1996, Bryn Paul Arnold Jones wrote:

> On Mon, 28 Oct 1996 psychos@xeo.net wrote:
>
> > On Mon, 28 Oct 1996, Eduardo Diaz Comellas wrote:
> >
> > > Hi!
> > >
> > > I was wandering how to stop a process, reboot the machine, and
> > > restart that process. Is there a way to provoke a program to dump
> > > itself, and restart it after the reboot?
> > >
> > > Maybe we can define a new executable format for it to work ;-)
> > >
> > > Cheers!
> >
> > This would be practically impossible as you'd have to load the program
> > into the exact same memory space or all of its pointers would be bad...
> > Memory fragmentation issues would make it very hard to get any program to
> > occupy the exact same space it did before.
> >
>
> Hmm, why is memory fragmentation a problem ? We're restoring after a
> reboot, the memory just got defraged, anyway is there any reason why we
> can't do a position independant coredump (in it's simplest form, subtract
> the lowest pointer/memory refrance from all the others, and just add any
> number to all values when it's restored) ?
>
> > The only way to really reload anything would be to dump the entire system
> > memory to a file and reload that. This could be useful if you wanted to do
> > something like boot into another operating system, or halt your computer
> > for whatever reason.
>
> Hmm, I'm suprised that other OS's can't do this (or can you keep a totally
> swaped out process "running" over a reboot ?), I would have thought that
> an OS that needs a 'shutdown -r now' in it's crontab to avoid running out
> of memory due to leaks.
>
> > (Of course, real Linux users never reboot or shut down, except for a
> > hardware or kernel upgrade ;)
> >
> Don't forget power failure, and electrical storms ;)
> Bryn

When processes allocate memory, they can get it from anywhere in the
memory space... There isn't any mechanism to ensure that each program's
memory segment is continuous. When the program restarts, something else
might have taken up one of the blocks that it wants to get... So the
kernel would have to be modified to set aside whatever space a program
that needs to be restarted would allocate.

This would be much easier on a system where each program has a specified
chunk of memory (such as a Mac). Of course, this is very inefficient as
each program holds aside memory that no other program can get at. (Then
you end up with things like RAM Doubler to reclaim these unused chunks :)


\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.346 / U:1.068 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site