OS Suspend to disk (Google Summer of Code)

John Baldwin jhb at freebsd.org
Thu Apr 3 19:11:41 UTC 2008


On Thursday 03 April 2008 04:14:09 am Andrew Pilloud wrote:
> Hello,
> 
> I am working on a project proposal for Google Summer of Code. I am 
> hoping to be able to implement OS based suspend to disk for FreeBSD. 
> Anyway, I have a few questions and a request:
> 
> 1. Is anyone currently working on OS based suspend to disk? (I'm pretty 
> sure it's no, but I don't want to duplicate anyone else's efforts)
> 2. Would anyone be interested in being a mentor for this project?
> 3. Any feedback on my application would be appreciated. My application 
> is here:
> http://www.ampmouse.com/code/8-gsoc2008/24-application.html

Hmm, the idea of reading the saved image in during early boot is a bit 
different.  One thing to note is that / does have to be mounted for rc 
scripts to run (so at least one filesystem will already be mounted).  One 
thing that might make it easier though, is to just require a separate disk 
partition (like swap, but a dedicated one, not reusing swap) to dump the RAM 
image into.  Later on you could extend it to use a pre-allocated file on a 
filesystem perhaps, but using a dedicated partition for now might reduce the 
work needed.  I think if you can dump all of RAM to a suspend partition then 
it actually is not too hard to make the loader just read that into RAM with 
some sort of header to give an entry point (and to validate it).

Some things that would be really nice for S4 suspend though would be to have 
the system try to quiesce things more during suspend than it does now.  For 
example, it would be nice if suspend would flush pending writes to disk and 
possibly mark filesystems as clean before actually going to sleep to minimize 
data loss (this would be useful even for S1 or S3 if the battery runs out 
while suspended).

-- 
John Baldwin


More information about the freebsd-acpi mailing list