SlideShare une entreprise Scribd logo
1  sur  46
Télécharger pour lire hors ligne
Improving MeeGo Boot-Up Time

Hiroshi DOYU <Hiroshi.DOYU@nokia.com>

      September 2010, LinuxCon Japan
Preface
Background
Handset Boot-Up status
My experiment
Further optimization idea
Q&A
Preface
Inspired by QuickBoot
  Ubiqutous QuickBoot




http://www.ubiquitous.co.jp/En/products/middleware/quickboot
Embedded Linux Wiki
  Boot Time - eLinux.org




http://elinux.org/Boot_Time
Tributed to Tim Bird
 Improving Android Boot-Up Time
Background
Impact of boot-up time
For consumer client device

  User experience
    TV, IVI, Camera
     Immediate action is preferable right after power on.
    Tablet, netbook, handset
     Is cold start really necessary?
    More complicated S/W stacks, more memory consumed.
  Mass Production test
    The more time a device spends on the production line, the more expensive.
Boot-Up time definition
Until when?

  When Login prompt appears.
  When Desktop shows up.
  When Network is available.
  When Browser is ready.
  When it can take a picture.
  When CPU goes into idle.
This depends on:
     Your H/W configuration.
     Your S/W configuration.
     Your system requirements.
The shortest isn’t always the best.
Measurement method(kernel)
   printk timestamps
    show_delta: linux-2.6/scripts/show_delta, a python script
   initcall debugging
dmesg -s 256000 | grep "initcall" | 
     sed "s/(.*)after(.*)/2 1/g" | sort -r -n
   bootgraph
dmesg | 
 linux-2.6.git/scripts/bootgraph.pl > output.svg
   ftrace
Measurement method(userland)
   uptime
/ # cat /proc/uptime
18.73 14.24
/ # cat /proc/uptime
20.55 16.05
   bootchart
    A newer version is released in MeeGo
     No additional tool to create svg. Directly created.

  entire measurement
    Including bootloader, kernel and userland
  grabserial
    show_delta, again
  oprofile
    ETM, Embedded Trace Macrocell, H/W assisted
Existing Optimization techniques
   kernel optimization
     asynchronous initcall
     asynchronous resume/suspend
     misc: preset lpj, no probe, no console, deferred module loading
   userland optimization
     initscript: upstart or systemd. Do it in parallel
     readahead
     prelink
   hibernation based optimization
     snapshot boot
     InstantBoot
     Warp2
     QuickBoot


BIOS/bootloader assisted.
Is cold start still necessary?
 Do we need cold start so often?
 Flashing a hibernation image in advance could reduce the production
 line usetime.
 Optimization may depend on your product specific part
  S/W configuration
  H/W configuration
  Your system requirement
 Wouldn’t hibernation be ok in most cases?
Handset Boot-Up status
Handset requirement
 Responsiveness of device/applications
  Quick response could improve UX, especially Handsets.
   One touch can choose a friend from "contact list".
   One touch can start camera. Same as digital camera.
   One touch can start web browsing.
   A call has to be processed within a short time, from operator spec.


 Resolving dynamic libraries takes more time than swapping in pages.
 All major applications can be started but invisible
  Then, visible upon request.
 RAM is occupied with started applications/daemons.
Handset Boot-Up time
 N900 boot-up takes ~40 sec
  Until Desktop shows up.
 Number of applications 137
 Swap status
Handset Bootgraph
Handset BootChart
Handset memuse
N900 Boot time breakdown
 Bootloader: 0.44 sec
 Kernel: 2.68 sec.
  With serial console.
  Could be shorter without serial console.
 Desktop: 39.03 sec
My experiment
Target spec
 OMAP3 based reference board
  Similar to N900
 512MB RAM
 MeeGo Handset
  Number of applications ~161
  ~120 sec with all application boot-up done
  Swap status
No hibernation support for ARM
   There was no hibernation support for ARM.
   Picked up old patch, and upgraded to v2.6.35.
   Rejected by RMK because:
     Need to be synch’ed with suspend-to-ram
     Lack of PXA support
     coprocessor differences between ARM versions
mrc p15, 0, %0, c2, c0, 0


   At least, it works!
     Let’s proceed.
Which hibernation method to use?
Three implementation of hibernation

  1. swsusp
    Included in mainline kernel as default.
  2. uswsusp
    Userland implementation
  3. tuxonice
    Out of kernel, but many features
     Compression of images
     multiple thread I/O
     readahead
     LVM support
Start with swsusp
  To start hibernation
echo disk > /sys/power/state
swsusp/eMMC
swsusp/eMMC
Use mtdblock rather than eMMC
 mtdblock is much faster than eMMC.
  mtdblock
   ~23 MB/sec/READ
  eMMC
   ~20 MB/sec/READ
   ~15 MB/sec/READ

 This is a HACK since:
  mtdblock itself is bogus without wear-leveling support.
  mtdswap is *volatile*.
   Good performance
   But cannot be used for hibernation.
  Need non-volatile mtdswap!!
swsusp/MTD
swsusp/MTD
Port TuxOnIce on ARM
TuxOnIce has many optimization features:

  Compression of images
  multiple threaded I/O
  readahead
  LVM support
  To drop pagecache
echo -2 > /sys/power/tuxonice/image_size_limit
  To start hibernation
echo disk > /sys/power/tuxonice/do_hibernation
TuxOnIce/MTD
TuxOnIce/MTD
Shrink memory before hibernation
  Reclaim memory as much as possible right before hibernation.
echo 10000 > /sys/power/shrink_mem
TuxOnIce/MTD/shirink_mem
TuxOnIce/MTD/shirink_mem
What is the bottleneck?
 The smaller RAM consumed, the lesser boot time.
  But cannot squeeze any more after certain size
 In our case:
  size: ~110 MB
  ~70% of boot time is spent on (compressed) image restoration.
meminfo/shirink_mem
What occupies RAM?
 Who uses lots of memory
  MeeGo "memuse" can identify.
Why unevictable?
  Recent SoC has smart coprocessors
    GPU, DSP and H/W accelerators.
  They may have IOMMU.
  More memory could be shared with coprocessors




http://en.wikipedia.org/wiki/IOMMU
Why does IOMMU have an effect?
 pages have to be DMA’able.
 Shared pages have to be pinned.
  They shouldn’t be swapped out.
   Unevictable
Further optimization idea
Linearity of hibernation method
  Linux VM tries to occupy RAM as much as possible(ex: page cache).
  RAM consumption can be squeezed at certain point.
  The boot time increases in proportion to the size of unevictable
  memory.


For further optimization, we need something more!
Proposals
  1. To increase read performance of storage
   Faster storage?
     mtd gets shorter boot-up time than eMMC
     faster mtd gets shorter boot-up time than slower mtd
     non-volatile mtdswap driver
   LVM swap to improve disk performance by raid-0
  2. Still to decrease image size
   Kill & restart bloated Apps if possible.
     maybe a bit brutal, but it works certainly.
   Swap out unevictable pages
     How to ensure if those pages exisit when it’s necessary?
   page coloring
     memory cgroup, which process page can be swapped out

  3. Lazy image/page loading


Don’t we forget the system responsiveness?
Example: Ubiquitous QuickBoot
  Can be considered as "Lazy image/page loading":




http://www.ubiquitous.co.jp/En/products/middleware/quickboot
Q&A
Thank you!




Please send comments toHiroshi.DOYU@nokia.com

Contenu connexe

Tendances

Dave Gilbert - KVM and QEMU
Dave Gilbert - KVM and QEMUDave Gilbert - KVM and QEMU
Dave Gilbert - KVM and QEMUDanny Abukalam
 
Raspberry pi on java 20121110
Raspberry pi on java 20121110Raspberry pi on java 20121110
Raspberry pi on java 20121110Masafumi Ohta
 
Windows Server "10": что нового в виртуализации
Windows Server "10": что нового в виртуализацииWindows Server "10": что нового в виртуализации
Windows Server "10": что нового в виртуализацииВиталий Стародубцев
 
Unity optimization techniques applied in Catan Universe
Unity optimization techniques applied in Catan UniverseUnity optimization techniques applied in Catan Universe
Unity optimization techniques applied in Catan UniverseExozet Berlin GmbH
 
Scheduler Support for Video-oriented Multimedia on Client-side Virtualization
Scheduler Support for Video-oriented Multimedia on Client-side VirtualizationScheduler Support for Video-oriented Multimedia on Client-side Virtualization
Scheduler Support for Video-oriented Multimedia on Client-side VirtualizationHwanju Kim
 
Application Live Migration in LAN/WAN Environment
Application Live Migration in LAN/WAN EnvironmentApplication Live Migration in LAN/WAN Environment
Application Live Migration in LAN/WAN EnvironmentMahendra Kutare
 
6. Live VM migration
6. Live VM migration6. Live VM migration
6. Live VM migrationHwanju Kim
 
3. CPU virtualization and scheduling
3. CPU virtualization and scheduling3. CPU virtualization and scheduling
3. CPU virtualization and schedulingHwanju Kim
 
Cloud os launch journey to cloud os with windows server 2012 r2
Cloud os launch   journey to cloud os with windows server 2012 r2 Cloud os launch   journey to cloud os with windows server 2012 r2
Cloud os launch journey to cloud os with windows server 2012 r2 Susantha Silva
 
Demand-Based Coordinated Scheduling for SMP VMs
Demand-Based Coordinated Scheduling for SMP VMsDemand-Based Coordinated Scheduling for SMP VMs
Demand-Based Coordinated Scheduling for SMP VMsHwanju Kim
 
VM201 - IdoSphere
VM201 - IdoSphereVM201 - IdoSphere
VM201 - IdoSphereCarl Tyler
 
Introduction to Virtualization, Virsh and Virt-Manager
Introduction to Virtualization, Virsh and Virt-ManagerIntroduction to Virtualization, Virsh and Virt-Manager
Introduction to Virtualization, Virsh and Virt-Managerwalkerchang
 
Virtualization Technology Overview
Virtualization Technology OverviewVirtualization Technology Overview
Virtualization Technology OverviewOpenCity Community
 

Tendances (17)

Dave Gilbert - KVM and QEMU
Dave Gilbert - KVM and QEMUDave Gilbert - KVM and QEMU
Dave Gilbert - KVM and QEMU
 
Storm v0.2
Storm v0.2Storm v0.2
Storm v0.2
 
Raspberry pi on java 20121110
Raspberry pi on java 20121110Raspberry pi on java 20121110
Raspberry pi on java 20121110
 
Windows Server "10": что нового в виртуализации
Windows Server "10": что нового в виртуализацииWindows Server "10": что нового в виртуализации
Windows Server "10": что нового в виртуализации
 
Unity optimization techniques applied in Catan Universe
Unity optimization techniques applied in Catan UniverseUnity optimization techniques applied in Catan Universe
Unity optimization techniques applied in Catan Universe
 
Scheduler Support for Video-oriented Multimedia on Client-side Virtualization
Scheduler Support for Video-oriented Multimedia on Client-side VirtualizationScheduler Support for Video-oriented Multimedia on Client-side Virtualization
Scheduler Support for Video-oriented Multimedia on Client-side Virtualization
 
Usenix Invited Talk
Usenix Invited TalkUsenix Invited Talk
Usenix Invited Talk
 
Application Live Migration in LAN/WAN Environment
Application Live Migration in LAN/WAN EnvironmentApplication Live Migration in LAN/WAN Environment
Application Live Migration in LAN/WAN Environment
 
6. Live VM migration
6. Live VM migration6. Live VM migration
6. Live VM migration
 
All Virtual All The Time
All Virtual All The TimeAll Virtual All The Time
All Virtual All The Time
 
3. CPU virtualization and scheduling
3. CPU virtualization and scheduling3. CPU virtualization and scheduling
3. CPU virtualization and scheduling
 
Cloud os launch journey to cloud os with windows server 2012 r2
Cloud os launch   journey to cloud os with windows server 2012 r2 Cloud os launch   journey to cloud os with windows server 2012 r2
Cloud os launch journey to cloud os with windows server 2012 r2
 
Demand-Based Coordinated Scheduling for SMP VMs
Demand-Based Coordinated Scheduling for SMP VMsDemand-Based Coordinated Scheduling for SMP VMs
Demand-Based Coordinated Scheduling for SMP VMs
 
VM201 - IdoSphere
VM201 - IdoSphereVM201 - IdoSphere
VM201 - IdoSphere
 
Azboxme blindscan
Azboxme blindscanAzboxme blindscan
Azboxme blindscan
 
Introduction to Virtualization, Virsh and Virt-Manager
Introduction to Virtualization, Virsh and Virt-ManagerIntroduction to Virtualization, Virsh and Virt-Manager
Introduction to Virtualization, Virsh and Virt-Manager
 
Virtualization Technology Overview
Virtualization Technology OverviewVirtualization Technology Overview
Virtualization Technology Overview
 

En vedette

Community trifft Development - Umgang mit Bugs bei maemo / Meego
Community trifft Development - Umgang mit Bugs bei maemo / MeegoCommunity trifft Development - Umgang mit Bugs bei maemo / Meego
Community trifft Development - Umgang mit Bugs bei maemo / MeegoUwe Kaminski
 
MeeGo 1.2 Harmattan - Development & Community Processes
MeeGo 1.2 Harmattan - Development & Community ProcessesMeeGo 1.2 Harmattan - Development & Community Processes
MeeGo 1.2 Harmattan - Development & Community ProcessesUwe Kaminski
 
Development of a Windows 8 app based on ImmobilienScout24 REST API
Development of a Windows 8 app based on ImmobilienScout24 REST APIDevelopment of a Windows 8 app based on ImmobilienScout24 REST API
Development of a Windows 8 app based on ImmobilienScout24 REST APIUwe Kaminski
 
2nd mobile-freidae - Community News
2nd mobile-freidae - Community News2nd mobile-freidae - Community News
2nd mobile-freidae - Community NewsUwe Kaminski
 

En vedette (6)

Community trifft Development - Umgang mit Bugs bei maemo / Meego
Community trifft Development - Umgang mit Bugs bei maemo / MeegoCommunity trifft Development - Umgang mit Bugs bei maemo / Meego
Community trifft Development - Umgang mit Bugs bei maemo / Meego
 
MeeGo 1.2 Harmattan - Development & Community Processes
MeeGo 1.2 Harmattan - Development & Community ProcessesMeeGo 1.2 Harmattan - Development & Community Processes
MeeGo 1.2 Harmattan - Development & Community Processes
 
Development of a Windows 8 app based on ImmobilienScout24 REST API
Development of a Windows 8 app based on ImmobilienScout24 REST APIDevelopment of a Windows 8 app based on ImmobilienScout24 REST API
Development of a Windows 8 app based on ImmobilienScout24 REST API
 
2nd mobile-freidae - Community News
2nd mobile-freidae - Community News2nd mobile-freidae - Community News
2nd mobile-freidae - Community News
 
MeeGo linux os
MeeGo linux os MeeGo linux os
MeeGo linux os
 
Qt 5 - C++ and Widgets
Qt 5 - C++ and WidgetsQt 5 - C++ and Widgets
Qt 5 - C++ and Widgets
 

Similaire à Improving MeeGo boot-up time

Enabling POWER 8 advanced features on Linux
Enabling POWER 8 advanced features on LinuxEnabling POWER 8 advanced features on Linux
Enabling POWER 8 advanced features on LinuxSebastien Chabrolles
 
Rloader, alternative tech to achieve fast boot time for ARM Linux
Rloader, alternative tech to achieve fast boot time for ARM LinuxRloader, alternative tech to achieve fast boot time for ARM Linux
Rloader, alternative tech to achieve fast boot time for ARM Linuxmatt_hsu
 
Renesas DevCon 2010: Starting a QT Application with Minimal Boot
Renesas DevCon 2010: Starting a QT Application with Minimal BootRenesas DevCon 2010: Starting a QT Application with Minimal Boot
Renesas DevCon 2010: Starting a QT Application with Minimal Bootandrewmurraympc
 
Lonestar php scalingmagento
Lonestar php scalingmagentoLonestar php scalingmagento
Lonestar php scalingmagentoMathew Beane
 
Cloud-Aided Yocto Build Speedup
Cloud-Aided Yocto Build SpeedupCloud-Aided Yocto Build Speedup
Cloud-Aided Yocto Build SpeedupToradex
 
TI TechDays 2010: swiftBoot
TI TechDays 2010: swiftBootTI TechDays 2010: swiftBoot
TI TechDays 2010: swiftBootandrewmurraympc
 
Introductiontoasp netwindbgdebugging-100506045407-phpapp01
Introductiontoasp netwindbgdebugging-100506045407-phpapp01Introductiontoasp netwindbgdebugging-100506045407-phpapp01
Introductiontoasp netwindbgdebugging-100506045407-phpapp01Camilo Alvarez Rivera
 
Enhanced Live Migration for Intensive Memory Loads
Enhanced Live Migration for Intensive Memory LoadsEnhanced Live Migration for Intensive Memory Loads
Enhanced Live Migration for Intensive Memory LoadsSamsung Open Source Group
 
CloudOpen 2013: Developing cloud infrastructure: from scratch: the tale of an...
CloudOpen 2013: Developing cloud infrastructure: from scratch: the tale of an...CloudOpen 2013: Developing cloud infrastructure: from scratch: the tale of an...
CloudOpen 2013: Developing cloud infrastructure: from scratch: the tale of an...Andrey Korolyov
 
z/VM Performance Analysis
z/VM Performance Analysisz/VM Performance Analysis
z/VM Performance AnalysisRodrigo Campos
 
”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016Kuniyasu Suzaki
 
Techiques for Writing Embedded Code_Internet of Things
Techiques for Writing Embedded Code_Internet of ThingsTechiques for Writing Embedded Code_Internet of Things
Techiques for Writing Embedded Code_Internet of Thingsalengadan
 
The Lies We Tell Our Code (#seascale 2015 04-22)
The Lies We Tell Our Code (#seascale 2015 04-22)The Lies We Tell Our Code (#seascale 2015 04-22)
The Lies We Tell Our Code (#seascale 2015 04-22)Casey Bisson
 
Introduction to Real Time Java
Introduction to Real Time JavaIntroduction to Real Time Java
Introduction to Real Time JavaDeniz Oguz
 
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...Amazon Web Services
 

Similaire à Improving MeeGo boot-up time (20)

Enabling POWER 8 advanced features on Linux
Enabling POWER 8 advanced features on LinuxEnabling POWER 8 advanced features on Linux
Enabling POWER 8 advanced features on Linux
 
Rloader, alternative tech to achieve fast boot time for ARM Linux
Rloader, alternative tech to achieve fast boot time for ARM LinuxRloader, alternative tech to achieve fast boot time for ARM Linux
Rloader, alternative tech to achieve fast boot time for ARM Linux
 
Renesas DevCon 2010: Starting a QT Application with Minimal Boot
Renesas DevCon 2010: Starting a QT Application with Minimal BootRenesas DevCon 2010: Starting a QT Application with Minimal Boot
Renesas DevCon 2010: Starting a QT Application with Minimal Boot
 
Lonestar php scalingmagento
Lonestar php scalingmagentoLonestar php scalingmagento
Lonestar php scalingmagento
 
Cloud-Aided Yocto Build Speedup
Cloud-Aided Yocto Build SpeedupCloud-Aided Yocto Build Speedup
Cloud-Aided Yocto Build Speedup
 
TI TechDays 2010: swiftBoot
TI TechDays 2010: swiftBootTI TechDays 2010: swiftBoot
TI TechDays 2010: swiftBoot
 
Introductiontoasp netwindbgdebugging-100506045407-phpapp01
Introductiontoasp netwindbgdebugging-100506045407-phpapp01Introductiontoasp netwindbgdebugging-100506045407-phpapp01
Introductiontoasp netwindbgdebugging-100506045407-phpapp01
 
Enhanced Live Migration for Intensive Memory Loads
Enhanced Live Migration for Intensive Memory LoadsEnhanced Live Migration for Intensive Memory Loads
Enhanced Live Migration for Intensive Memory Loads
 
CloudOpen 2013: Developing cloud infrastructure: from scratch: the tale of an...
CloudOpen 2013: Developing cloud infrastructure: from scratch: the tale of an...CloudOpen 2013: Developing cloud infrastructure: from scratch: the tale of an...
CloudOpen 2013: Developing cloud infrastructure: from scratch: the tale of an...
 
z/VM Performance Analysis
z/VM Performance Analysisz/VM Performance Analysis
z/VM Performance Analysis
 
”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016
 
Techiques for Writing Embedded Code_Internet of Things
Techiques for Writing Embedded Code_Internet of ThingsTechiques for Writing Embedded Code_Internet of Things
Techiques for Writing Embedded Code_Internet of Things
 
Group 7 bank...
Group 7   bank...Group 7   bank...
Group 7 bank...
 
Os Vandeven
Os VandevenOs Vandeven
Os Vandeven
 
The Lies We Tell Our Code (#seascale 2015 04-22)
The Lies We Tell Our Code (#seascale 2015 04-22)The Lies We Tell Our Code (#seascale 2015 04-22)
The Lies We Tell Our Code (#seascale 2015 04-22)
 
Hyper v r2 deep dive
Hyper v r2 deep diveHyper v r2 deep dive
Hyper v r2 deep dive
 
SQL Server On SANs
SQL Server On SANsSQL Server On SANs
SQL Server On SANs
 
Xen time machine
Xen time machineXen time machine
Xen time machine
 
Introduction to Real Time Java
Introduction to Real Time JavaIntroduction to Real Time Java
Introduction to Real Time Java
 
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
 

Improving MeeGo boot-up time

  • 1. Improving MeeGo Boot-Up Time Hiroshi DOYU <Hiroshi.DOYU@nokia.com> September 2010, LinuxCon Japan
  • 2. Preface Background Handset Boot-Up status My experiment Further optimization idea Q&A
  • 4. Inspired by QuickBoot Ubiqutous QuickBoot http://www.ubiquitous.co.jp/En/products/middleware/quickboot
  • 5. Embedded Linux Wiki Boot Time - eLinux.org http://elinux.org/Boot_Time
  • 6. Tributed to Tim Bird Improving Android Boot-Up Time
  • 8. Impact of boot-up time For consumer client device User experience TV, IVI, Camera Immediate action is preferable right after power on. Tablet, netbook, handset Is cold start really necessary? More complicated S/W stacks, more memory consumed. Mass Production test The more time a device spends on the production line, the more expensive.
  • 9. Boot-Up time definition Until when? When Login prompt appears. When Desktop shows up. When Network is available. When Browser is ready. When it can take a picture. When CPU goes into idle. This depends on: Your H/W configuration. Your S/W configuration. Your system requirements. The shortest isn’t always the best.
  • 10. Measurement method(kernel) printk timestamps show_delta: linux-2.6/scripts/show_delta, a python script initcall debugging dmesg -s 256000 | grep "initcall" | sed "s/(.*)after(.*)/2 1/g" | sort -r -n bootgraph dmesg | linux-2.6.git/scripts/bootgraph.pl > output.svg ftrace
  • 11. Measurement method(userland) uptime / # cat /proc/uptime 18.73 14.24 / # cat /proc/uptime 20.55 16.05 bootchart A newer version is released in MeeGo No additional tool to create svg. Directly created. entire measurement Including bootloader, kernel and userland grabserial show_delta, again oprofile ETM, Embedded Trace Macrocell, H/W assisted
  • 12. Existing Optimization techniques kernel optimization asynchronous initcall asynchronous resume/suspend misc: preset lpj, no probe, no console, deferred module loading userland optimization initscript: upstart or systemd. Do it in parallel readahead prelink hibernation based optimization snapshot boot InstantBoot Warp2 QuickBoot BIOS/bootloader assisted.
  • 13. Is cold start still necessary? Do we need cold start so often? Flashing a hibernation image in advance could reduce the production line usetime. Optimization may depend on your product specific part S/W configuration H/W configuration Your system requirement Wouldn’t hibernation be ok in most cases?
  • 15. Handset requirement Responsiveness of device/applications Quick response could improve UX, especially Handsets. One touch can choose a friend from "contact list". One touch can start camera. Same as digital camera. One touch can start web browsing. A call has to be processed within a short time, from operator spec. Resolving dynamic libraries takes more time than swapping in pages. All major applications can be started but invisible Then, visible upon request. RAM is occupied with started applications/daemons.
  • 16. Handset Boot-Up time N900 boot-up takes ~40 sec Until Desktop shows up. Number of applications 137 Swap status
  • 20. N900 Boot time breakdown Bootloader: 0.44 sec Kernel: 2.68 sec. With serial console. Could be shorter without serial console. Desktop: 39.03 sec
  • 22. Target spec OMAP3 based reference board Similar to N900 512MB RAM MeeGo Handset Number of applications ~161 ~120 sec with all application boot-up done Swap status
  • 23. No hibernation support for ARM There was no hibernation support for ARM. Picked up old patch, and upgraded to v2.6.35. Rejected by RMK because: Need to be synch’ed with suspend-to-ram Lack of PXA support coprocessor differences between ARM versions mrc p15, 0, %0, c2, c0, 0 At least, it works! Let’s proceed.
  • 24. Which hibernation method to use? Three implementation of hibernation 1. swsusp Included in mainline kernel as default. 2. uswsusp Userland implementation 3. tuxonice Out of kernel, but many features Compression of images multiple thread I/O readahead LVM support
  • 25. Start with swsusp To start hibernation echo disk > /sys/power/state
  • 28. Use mtdblock rather than eMMC mtdblock is much faster than eMMC. mtdblock ~23 MB/sec/READ eMMC ~20 MB/sec/READ ~15 MB/sec/READ This is a HACK since: mtdblock itself is bogus without wear-leveling support. mtdswap is *volatile*. Good performance But cannot be used for hibernation. Need non-volatile mtdswap!!
  • 31. Port TuxOnIce on ARM TuxOnIce has many optimization features: Compression of images multiple threaded I/O readahead LVM support To drop pagecache echo -2 > /sys/power/tuxonice/image_size_limit To start hibernation echo disk > /sys/power/tuxonice/do_hibernation
  • 34. Shrink memory before hibernation Reclaim memory as much as possible right before hibernation. echo 10000 > /sys/power/shrink_mem
  • 37. What is the bottleneck? The smaller RAM consumed, the lesser boot time. But cannot squeeze any more after certain size In our case: size: ~110 MB ~70% of boot time is spent on (compressed) image restoration.
  • 39. What occupies RAM? Who uses lots of memory MeeGo "memuse" can identify.
  • 40. Why unevictable? Recent SoC has smart coprocessors GPU, DSP and H/W accelerators. They may have IOMMU. More memory could be shared with coprocessors http://en.wikipedia.org/wiki/IOMMU
  • 41. Why does IOMMU have an effect? pages have to be DMA’able. Shared pages have to be pinned. They shouldn’t be swapped out. Unevictable
  • 43. Linearity of hibernation method Linux VM tries to occupy RAM as much as possible(ex: page cache). RAM consumption can be squeezed at certain point. The boot time increases in proportion to the size of unevictable memory. For further optimization, we need something more!
  • 44. Proposals 1. To increase read performance of storage Faster storage? mtd gets shorter boot-up time than eMMC faster mtd gets shorter boot-up time than slower mtd non-volatile mtdswap driver LVM swap to improve disk performance by raid-0 2. Still to decrease image size Kill & restart bloated Apps if possible. maybe a bit brutal, but it works certainly. Swap out unevictable pages How to ensure if those pages exisit when it’s necessary? page coloring memory cgroup, which process page can be swapped out 3. Lazy image/page loading Don’t we forget the system responsiveness?
  • 45. Example: Ubiquitous QuickBoot Can be considered as "Lazy image/page loading": http://www.ubiquitous.co.jp/En/products/middleware/quickboot
  • 46. Q&A Thank you! Please send comments toHiroshi.DOYU@nokia.com