2011/4/20 Duong "Yang" Ha Nguyen <[email protected]>: > On Wed, 20 Apr 2011, Gwenhael Le Moine wrote: > >> 2011/4/20 Hieu D. Bui <[email protected]>: >> > >> > In my use case, I would like to ensure that all the open documents have >> > been synced to disk before I drop the cache (which reduces the memory >> > used size, therefore it fastens the hibernation process). Sometimes, >> > hibernation doesn't work properly too, for example, it can't freeze >> > the filesystems and/or processes. >> > >> > D. Hieu >> >> Interesting idea. I wasn't sure if hibernating would effectively save >> disk-caches and a quick say it does and suggest to do what you want to >> do. >> > > Dear folks, > > Suspend-to-disk (aka hibernation) doesn't call sync() before > performing. I've got several page-fault situations and data > corruption when doing improperly hibernating (i.e. plugging on/off > some peripheral devices, especially USB flash disk). >
I'd report this as a bug. (I just checked my /etc/acpi/acpi_handler.sh and sure enough I put a 'sync' before suspending and hibernating.) >> >> But I think there's a trade-off to that technique: when the computers >> wake up it won't have any disk cache and will spend some time to >> rebuild it, so for some time after wake-up the computer might be less >> responsive. >> > > That's not necessary true, depending on the techniques your operating > system uses. Hibernation does almost exactly the same as > suspend-to-ram, except for the destination to store data. > What? No, suspend-to-ram puts the computer in a deep sleep with the ram and little else powered, no data is moved. Hibernate writes the ram to disk and then power-off completly, next boot is a cold boot and at some point the presence of hibernated data is detected and loaded. >> >> Personally I've stopped hubernating years ago, suspend-to-ram is >> nearly instant and has never failed me (and my wife is constantly >> stealing my laptop because hers take ages to get out of hibernation :P >> ) >> >> Gwenhael >> > > Suspend-to-ram still consumes energy, man. Hibernation is for greener > planet ;-). My computers are almost always on anyway, the only time they sleep is when they're moving from one point to another in my bag, hibernation is for when their insides need dusting, reboot is for kernel upgrades, halt is almost unheard of (hardware change.) The last 3 actions involve having to type root's password :D How much energy does writing 2 or 3Gio to disk + a cold boot + restoring the 2 or 3Gio consume? From which amount of time does it make more sense to hibernate then to suspend-to-ram? I don't have the tooling necessary to mesure this unfortunately but it's an interesting question. > > Cheers, > Yang > -- > Dương "Yang" Hà Nguyễn > Web log: http://cmpitg.wordpress.com/ > "Life is a hack" > > [ Do not send me Microsoft Office attachments, please. > http://www.gnu.org/philosophy/no-word-attachments.html ] > > -----BEGIN GEEK CODE BLOCK----- > Version: 3.12 > GIT/C/ED/L d++ s-:-(:) !a C+++(++++) ULU++++>$ P-- L+++>$ E+++ > W++>+++ N+ o+ K w--- O- M@ V- PS+ PE++ Y+>++ PGP++ t+ 5 X+ R- > tv+ b+++ DI+++ D++ G+++ e* h* r* y- > -----END GEEK CODE BLOCK----- > _______________________________________________ > POST RULES : http://wiki.hanoilug.org/hanoilug:mailing_list_guidelines > _______________________________________________ > HanoiLUG mailing lists: http://lists.hanoilug.org/ > HanoiLUG wiki: http://wiki.hanoilug.org/ > HanoiLUG blog: http://blog.hanoilug.org/ > _______________________________________________ POST RULES : http://wiki.hanoilug.org/hanoilug:mailing_list_guidelines _______________________________________________ HanoiLUG mailing lists: http://lists.hanoilug.org/ HanoiLUG wiki: http://wiki.hanoilug.org/ HanoiLUG blog: http://blog.hanoilug.org/
