rloader, alternative tech to achieve fast boot time for arm linux
Post on 13-May-2015
3.307 Views
Preview:
DESCRIPTION
TRANSCRIPT
Connect your device to application
Rloader,Alternative technology to achieve fast boot time for ARM Linux
Matt Hsu
<matt@0xlab.org>
Agenda Motivation
Boot Time Measurement
Reduction Approach
Hibernation Based Technologies
Rloader
Demo
Summary
Q & A
Movitation
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
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
Embedd Linux Wiki
Boot Time Measurement
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
User SpaceBootchart
http://www.bootchart.org/
cat /proc/uptime
2012.39 512.64
grabserialhttp://elinux.org/Grabserial
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
Reduction Approach
Divide and Conquer
Bootloader
Kernel
Userland
Bootloader
Minimal bootloaderQi bootloader
zboot, linux boot directly
Enable I-cache
Copy kernel into base + 0x2000000 offset
DMA-capable copy
Multi-block read (MMC)
KernelKernel parameter
quiet
Preset LPJLoop per jiffy
Deferred initcallinclude/linux/init.h
arch/arm/kernel/vmlinux.lds
Compressed kernelUCL
XZ
Userland
Optimize linker and loader timeSpecific linker option
Parallelize rc script
Application specific optimization
Hibernation based technologies
Hibernate-Based Technologies
Swsusp, aka software suspend
Swsusp2 (TuxOnICE)
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
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
Rloader, (Resume Loader)
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
Booting Process
Boottloaderinit
Kernel Init init.rc, platform-specific rc
Normal booting
Bootloaderinit
Minimal deviceInit
Restoreprocess
Bootloaderinit
Restoreprocess
Kernel as Rloader
Bootloader as Rloader
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
Hardware/Software Descripton
ARM OMAP3 Beagleboard
Kernel2.6.32 with corresponding TOI patch
BootloaderQi
256MB RAM
0xdroid Eclair
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
Normal Booting Time Diagram
Power On ResetGPIO signal of stepping into kernel
25 seconds
GPIO signal of Key-guard event
Hibernation Boot Time Diagram
GPIO signal of stepping into kernel
GPIO signal of Key-gurad event
6 seconds
Power On Reset
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
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
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
Demo
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
27 May 2011Conference
Sponsoredby
http://0xlab.org
top related