rloader, alternative tech to achieve fast boot time for arm linux
DESCRIPTION
There are many approaches to speed up boot time for embedded device. One of the interesting tech is based hibernation. Rloader is based on this kind of tech.TRANSCRIPT
![Page 1: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/1.jpg)
Connect your device to application
![Page 3: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/3.jpg)
Agenda Motivation
Boot Time Measurement
Reduction Approach
Hibernation Based Technologies
Rloader
Demo
Summary
Q & A
![Page 4: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/4.jpg)
Movitation
![Page 5: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/5.jpg)
Why Boot Time?Define boot time, please
Power saving
User experiences
Android's boot time is especially painful
DevicesTablet
In-vechile system
TV
Smart Phone
Camera
![Page 6: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/6.jpg)
We Are Not AloneQuick boot
Ubiqutous
Improving meego boot-up timeHiroshi DOYU, Nokia Sotware Architect
Boosting up embedded Linux device: experience on Linux-based smarphone
Samsung Electronics Co. Ltd.
Swap-before-hibernate: A fast-on algorithm at OS level
Shi-wu Lo, OS Lab, CCU
![Page 7: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/7.jpg)
Embedd Linux Wiki
![Page 8: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/8.jpg)
Boot Time Measurement
![Page 9: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/9.jpg)
Kernel spaceKernel parameter
printk.time =1
linux-2.6/scripts/show_delta
Ftraceftrace=initcall
InitcallEnable BOOT_TRACER config
./scripts/bootgraph.pl boot_time >out.svg
initcall_debug
![Page 10: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/10.jpg)
User SpaceBootchart
http://www.bootchart.org/
cat /proc/uptime
2012.39 512.64
grabserialhttp://elinux.org/Grabserial
![Page 11: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/11.jpg)
Hardware ApproachExternal instrument
Scope
Logic Analyzer
Hardware timer countResolution is dependent on your clock source
ETM (Embedded Trace Microcell)Need assisted software such as TRACE32/OpenOCD
New feature in ARM Cortex seies
![Page 12: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/12.jpg)
Reduction Approach
![Page 13: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/13.jpg)
Divide and Conquer
Bootloader
Kernel
Userland
![Page 14: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/14.jpg)
Bootloader
Minimal bootloaderQi bootloader
zboot, linux boot directly
Enable I-cache
Copy kernel into base + 0x2000000 offset
DMA-capable copy
Multi-block read (MMC)
![Page 15: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/15.jpg)
KernelKernel parameter
quiet
Preset LPJLoop per jiffy
Deferred initcallinclude/linux/init.h
arch/arm/kernel/vmlinux.lds
Compressed kernelUCL
XZ
![Page 16: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/16.jpg)
Userland
Optimize linker and loader timeSpecific linker option
Parallelize rc script
Application specific optimization
Hibernation based technologies
![Page 17: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/17.jpg)
Hibernate-Based Technologies
Swsusp, aka software suspend
Swsusp2 (TuxOnICE)
![Page 18: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/18.jpg)
Swsusp Natviely support in x86
Based on work byTI, Teerth Reddy
https://patchwork.kernel.org/patch/96442/
Nokia, Hiroshi DOYUhttps://lists.linux-foundation.org/pipermail/linux-pm/2010-June/027422.html
Start hibernationecho disk >/sys/power/state
![Page 19: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/19.jpg)
Swsusp2/TuxOnICENot support in main line kernel
Provides many featuresCompression of images
Readhead
multiple thread I/O
drop pagecache
Hbernation triggereho 1 >/sys/power/tuxonice/do_hibernation
![Page 20: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/20.jpg)
Rloader, (Resume Loader)
![Page 21: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/21.jpg)
Rloader Is Nothing NewDo we really need follow normal booting process?
The implementation of Rloader could beBootloader
snapshot boot
www.elinux.org/images/3/37/Snapshot-boot-final.pdf
Custom kernelKernel with software resume support
Different hibernation images make difference user scenario
![Page 22: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/22.jpg)
Booting Process
Boottloaderinit
Kernel Init init.rc, platform-specific rc
Normal booting
Bootloaderinit
Minimal deviceInit
Restoreprocess
Bootloaderinit
Restoreprocess
Kernel as Rloader
Bootloader as Rloader
![Page 23: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/23.jpg)
Make ARM Hibernated
Merge patchesswsusp patch from TI/Nokia
TOI patches according to your kernel version
'swap out' page as much as possible
ARM does not support ACPI
Currently, there are patches for ARM Cortex A8/A9 provided
![Page 24: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/24.jpg)
Hardware/Software Descripton
ARM OMAP3 Beagleboard
Kernel2.6.32 with corresponding TOI patch
BootloaderQi
256MB RAM
0xdroid Eclair
![Page 25: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/25.jpg)
Something before hibernating
echo 100 > /proc/sys/vm/swappiness
echo -2 > /sys/power/tuxonice/image_size_limit
echo 3 >/proc/sys/vm/drop_caches
busybox swapon -p 1 /dev/block/mtdX
![Page 26: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/26.jpg)
Normal Booting Time Diagram
Power On ResetGPIO signal of stepping into kernel
25 seconds
GPIO signal of Key-guard event
![Page 27: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/27.jpg)
Hibernation Boot Time Diagram
GPIO signal of stepping into kernel
GPIO signal of Key-gurad event
6 seconds
Power On Reset
![Page 28: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/28.jpg)
Rloader as Kernel or Bootloader?It's a trade-off between your boot time and management cost
MaintainenceOnce kernel/TOI changes, you need to re-implement
ComplexicityHow to restore pages?
Resume point? PC value?
Improved room might be limited
![Page 29: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/29.jpg)
Further OptimizationRe-construct initcall stages
Try different algorithm out on compressing images
http://code.google.com/p/snappy/
Lazy loading
Put driver state into hibernation image
![Page 30: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/30.jpg)
Summary
It's still far away from being a product
File system inconstencyPower failure as hibernation
Hardware solution is the sliver bullet?
The time of stepping into hibernation is also needed to concern
![Page 31: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/31.jpg)
Demo
![Page 32: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/32.jpg)
Resourcehttp://elinux.org/Boot_Time
http://tuxonice.net/
http://gitorious.org/improving-meego-boot-up-time/t2t/commit/d29d8576cf7969c1240e9f6420404c6329d3c524
www.kernel.org/doc/ols/2010/ols2010-pages-9-18.pdf
http://gitorious.org/+0xlab/0xlab-bootloader/qi-bootloader
http://www.oberhumer.com/opensource/ucl/
http://code.google.com/p/0xdroid/
www.kernel.org/doc/ols/2010/ols2010-pages-9-18.pdf
![Page 33: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/33.jpg)
![Page 34: Rloader, alternative tech to achieve fast boot time for ARM Linux](https://reader035.vdocuments.net/reader035/viewer/2022062307/5552df17b4c905014c8b4c9f/html5/thumbnails/34.jpg)
27 May 2011Conference
Sponsoredby
http://0xlab.org