Subject: Re: SOC project idea
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Perry E. Metzger <perry@piermont.com>
List: netbsd-users
Date: 03/08/2007 18:45:51
Manuel Bouyer <bouyer@antioche.eu.org> writes:
> What I don't get with this approach is how you write ram to disk, and
> then restore it from disk. You need some software which can do that.
> If you use a standalone program to do it you can restore the kernel
> in its exact state, but then you need a standalone tool which can talk to
> the disk. Or you use the kernel's disk drivers for this, but then this change
> the kernel's state (the driver may need to allocate memory for example), and
> restoring is tricky: you can't overwrite your currently running program with
> a previous state.

It is a bit tricky to have the kernel write out the state without
inducing too much of a state change but I don't think it is
particularly bad.

The way I'd manage this, I'd lock out userland, flush all dirty
buffers (both so there is no problem with the file system later if one
fails to wake up and to reduce the amount one needs to write out),
nuke all text pages you can demand page in later, etc.

Once your system is pretty quiescent, you probably need to write out
the system state quite carefully, as you note. That's probably where
all the ingenuity has to go in.

Perry