Hibernation for Pandora


cosurgi

http://janek.kozicki.pl/
Joined
Jul 30, 2008
Messages
1,098
Location
Gdansk, Poland
Website
janek.kozicki.pl
guys, have you seen that?


http://matthsu-abacus.blogspot.com/2010/12/make-beagleboard-to-be-hibernated.html

Previously, there's a Japanese company called Ubiquitous. It achieves very impressive demo which makes machine's boot time as one second. Its primitive idea is based on hibernation. IMHO, this solution is not _generic_ enough. It means that, the porting for platform would take a lot of effort. So it might be better to use more generic solution to achieve hibernation.

However, Hiroshi did a good job on improving boot time for Meego platform.


He gave a talk on LinuxConf in Japan. After his experiments, the boot time could be reduced about 3 seconds at some certain points.


http://www.slideshare.net/doyu/improving-meegobootuptime


or you can build the slide locally:


git clone git://gitorious.org/improving-meego-boot-up-time/t2t.git


Fortunately, his target platform is N900 whose CPU core is also ARM cortex A8 (OMAP3430). So, Beagleboard should be worked on hibernation. After some modification, either SWSUSP or TuxOnIce can work on Beagleboard.


Here is the result:


root@beagleboard:~# echo disk >/sys/power/state


[ 97.613098] Initiating a hibernation cycle.


[ 97.617980] Failed to launch userspace program '/usr/local/sbin/tuxoniceui_text': Error -2


[ 97.626403] Launch userspace program failed.


[ 97.630767] Freezing processes & syncing filesystems.


[ 97.635864] Stopping fuse filesystems.


[ 97.639648] Freezing user space processes ... (elapsed 0.00 seconds) done.


[ 99.313568] Stopping normal filesystems.


[ 99.379211] Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.


[ 99.435852] Preparing Image. Try 1.


[ 99.440734] Restarting normal filesystems.


[ 99.466796] Stopping fuse filesystems.


[ 99.470611] Freezing user space processes ... (elapsed 0.00 seconds) done.


[ 99.532409] Stopping normal filesystems.


[ 99.590179] Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.


[ 99.651702] Starting to save the image..


[ 99.655670] Writing caches...


[ 100.171966] ...20%...40%...60%...80%


[ 102.023406] Doing atomic copy/restore.


[ 102.027221] Suspending console(s) (use no_console_suspend to debug)


[ 102.906646] nand_resume called for a chip which is not in suspended state


[ 102.939483] Post atomic.


[ 102.942047] Writing kernel & process data...


[ 103.593719] ...20%...40%...60%...80%


[ 104.767242] Power down.


[ 104.769897] System halted.


[ 14.434020] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 1


[ 14.443267] TuxOnIce 3.2-rc2 (http://tuxonice.net)


[ 14.449829] TuxOnIce: Image found.


[ 14.982788] Failed to launch userspace program '/usr/local/sbin/tuxoniceui_text': Error -2


[ 14.991149] Launch userspace program failed.


[ 14.995513] Stopping fuse filesystems.


[ 14.999328] Freezing user space processes ... (elapsed 0.00 seconds) done.


[ 15.006591] Stopping normal filesystems.


[ 15.010559] Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.


[ 15.032104] Reading kernel & process data...


[ 15.420349] ...20%...40%...60%...80%


[ 15.822692] Atomic restore.


[ 15.825622] Doing atomic copy/restore.


[ 15.829376] Suspending console(s) (use no_console_suspend to debug)


[ 16.302551] omapdss DISPC error: SYNC_LOST, disabling LCD


[ 16.849487] nand_resume called for a chip which is not in suspended state


[ 17.184478] Post atomic.


[ 17.187103] Reading caches...


[ 18.130859] ...20%...40%...60%...80%


[ 18.612609] Cleaning up...


[ 18.616302] Restarting all filesystems ...


[ 18.620452] Restarting tasks ... Restarting tasks ... done.


[ 18.679138] TuxOnIce debugging info:


[ 18.679138] - TuxOnIce core : 3.2-rc2


[ 18.679168] - Kernel Version : 2.6.32.9-g25bf98b-dirty


[ 18.679168] - Compiler vers. : 4.4


[ 18.679168] - Attempt number : 3


[ 18.679168] - Parameters : 0 667648 0 0 0 0


[ 18.679199] - Overall expected compression percentage: 0.


[ 18.679199] - Compressor is 'lzo'.


[ 18.679199] Compressed 52920320 bytes into 16659760 (68 percent compression).


[ 18.679229] - Block I/O active.


[ 18.679229] Used 4110 pages from swap on /dev/......


[ 18.679229] - Max outstanding reads 404. Max writes 195.


[ 18.679229] Memory_needed: 1024 x (4096 + 200 + 72) = 4472832 bytes.


[ 18.679260] Free mem throttle point reached 0.


[ 18.679260] - Swap Allocator enabled.


[ 18.679260] Swap available for image: 34136 pages.


[ 18.679290] - File Allocator active.


[ 18.679290] Storage available for image: 0 pages.


[ 18.679290] - I/O speed: Write 12 MB/s, Read 22 MB/s.


[ 18.679290] - Extra pages : 0 used/2000.


[ 18.679321] - Result : Succeeded.


root@beagleboard:~#


Obviously, the boot time has a lot of space to improve. But it a first step to hack hibernation. And thanks Hiroshi's suggestion to make this working. :)

isn't that very close to what pandora is using?
 
Hmm, I recognise that name...


My dad used to have an UbiSurfer (Ubiquitous surfer) last year, and i frankly have to say that it was sh*t, it used a really bad ancient version of Ubuntu, and the keyboard buttons started dying out after a month of almost no use.


Lesson learnt: don't buy an Ubiquitous machine (unless my dads was a one off, the rest may have been kinda decent)
 
isn't that very close to what pandora is using?
The Pandora uses a suspend mode, the kernel simply halts the whole system and shuts down unneeded components, but the device still stays powered to not erase the RAM. The system goes into sleep and wakes up immediately, but it drains energy over time.


What you have there is hibernation, it is entirely different. The kernels halts the system and writes the whole RAM content on disk, usually into a swap partition. It takes a lot more time to get there, the unit powers off completely and needs to boot first when powering on again until the kernel initialised enough to be able to restore the system from the image on disk.


This is unacceptable for the Pandora as it doesn't have enough space, it would be killing the NAND and if being used with a SD card it will take a significant amount of time to go into sleep and wake up again due to the SD cards' slowness.
 
Can I atleast reassign a key to put the pandora into standy instead of sliding the power-switch? I believe that push-buttons are less prone to accidents than sliders....
 
Back
Top