LWN.net Logo

A pair of suspend2 patches

A pair of suspend2 patches

Posted Jul 30, 2005 8:36 UTC (Sat) by NCunningham (guest, #6457)
Parent article: A pair of suspend2 patches

"...simply flushing all pages to disk prior to beginning the suspend process would do the trick..."

Hi. This is precisely the point I've trying to make: Flushing all pages to disk prior to beginning the suspend process wouldn't do the trick. It is entirely possible that other processes will submit I/O while or after the flush runs. In addition, if other processes are submitting I/O while the sync is running, the sync may not return until after the other processes have submitted an awfully large amount of I/O (depending on patterns). I've been told that work is in progress to address this, but it still leaves the first problem.

The only way to address the race is to remove the race: stop processes submitting new I/O, sync the I/O that is there and then get on with suspending.

Regards,

Nigel


(Log in to post comments)

Dumbest question ever

Posted Aug 4, 2005 9:56 UTC (Thu) by rvfh (subscriber, #31018) [Link]

That's probably the dumbest question ever heard, but...
Why is it needed to flush dirty pages? Presumably, all pages are in the memory, which is going to be saved to disk anyway...
Why is it not possible to
  • stop all processes
  • tell all drivers to suspend (apart from hard-disk, of course)
  • copy memory contents and registers to disk
  • suspend system

Is there some document I could read about that so I'll ask more clever questions in the future?

Dumbest question ever

Posted Aug 6, 2005 15:54 UTC (Sat) by fjalvingh (guest, #4803) [Link]

I think the reason would be:

Dirty pages can also be pages from the file system. Not flushing them would put the FS in an inconsistent state - i.e. the changes are not written. This would not be a problem IF the machine was brought up again from the hibernated state, but if that fails then you have a damaged file system..

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds