150 likes | 159 Views
Improvement of startup time using Software Suspend - Project Update -. Sony Corporation Hiroki KAMINAGA kaminaga@sm.sony.co.jp. Contents:. aim swsusp functionality in detail use of swsusp for snapshot boot. AIM:. System startup time reduction
E N D
Improvement of startup time using Software Suspend- Project Update - Sony Corporation Hiroki KAMINAGA kaminaga@sm.sony.co.jp JapanTechnicalJamboree7
Contents: • aim • swsusp functionality in detail • use of swsusp for snapshot boot JapanTechnicalJamboree7
AIM: • System startup time reduction • By using image of known system state,we try to accomplish kernel, module, andapplication startup time reduction • Other aspect • By using system image as a file, we can tracesystem development progress and error. JapanTechnicalJamboree7
Target envirionment: • Target hardware • OMAP OSK 5912 starter kit • Target software • Linux kernel 2.6.11 • Omap patch • U-boot • Arm swsusp support patch(developed and posted to ML) Hardware Features: ARM9 core operating at 192 Mhz. DSP core operating at 192 Mhz. TLV320AIC23 Stereo Codec 32 Mbyte DDR SDRAM 32 Mbyte Flash ROM RS-232 Serial Port 10 MBPS Ethernet port USB Host Port Compact flash connector On board IEEE 1149.1 JTAG JapanTechnicalJamboree7
Swsusp (1): • 3 states supported by linux • Standby state • Minimal power savings, low latency to workingsystem. Cpu retains power. ACPI S1 • Suspend to ram • Sufficient power savings, system in low-power.Memory in self refresh mod. ACPI S3 • Suspend to disk • Greatest power savings, similar to suspend to ram,mem contents written to disk. ACPI S4 JapanTechnicalJamboree7
Swsusp (2): • Swsusp is suspend to disk(or suspend to swap, `sw` stands for swap) • Save image to nor flash instead of disk • On resume, read from nor flash instead ofdisk JapanTechnicalJamboree7
Swsusp (3): • Basic flow of swsusp (suspend phase) • Freeze processes • Free unnecessary memory • Suspend devices • Make snapshot image (in memory) • Resume devices • Write snapshot image to swap • Powerdown machine Note: swsusp needs half of total memory JapanTechnicalJamboree7
Swsusp (4): • Basic flow of swsusp (resume) • Resume begin at `late_initcall` • Read image from swap to mem • Freeze process • Suspend devices • Restore snapshot image • Resume devices • Thaw processes JapanTechnicalJamboree7
Swsusp (5): • Swsusp resume takes time. • Swsusp procedure is kicked at late_initcall • Almost before init process starts • Doing I/O twice • Swap to mem (allocated mem) • Mem to mem (allocated mem to orig mem addr) • Redundant device state transitions • Device gets setup, suspend, and resume again. JapanTechnicalJamboree7
Snapshot boot (1): • Co-operate kernel side suspend/resumeand boot loader side init setups • Use snapshot image created by kernel • Boot loader does: • Power up board • Load snapshot image to original memory • Initialize and do setups for resume • Jump to resume entry point(not normal entry point) JapanTechnicalJamboree7
Snapshot boot (2): restore regs resume dev continue process KERNEL LAND init board copy image setup dev BOOT LOADER ON JapanTechnicalJamboree7
Snapshot boot (3): • Implemented in u-boot boot loader • new command: • bootss <image addr> <resume entry point> • Procedure: • Load snapshot image in flash to mem • Initialization and setups • Setup clock speed • Setup timer • Setup various MMIO registers • Enable MMU • Jump to resume entry point JapanTechnicalJamboree7
DEMO: • [[[demo of swsusp and snapshot boot]]] JapanTechnicalJamboree7
Reference: • Swsusp.txt • Documentation/power/swsusp.txt • Uboot • http://sourceforge.net/projects/u-boot/ • Suspend2 • http://www.suspend2.net JapanTechnicalJamboree7
EOF JapanTechnicalJamboree7