【杨斌】安卓系统开机时间优化
2020-02-27 58浏览
- 1.Android Quick Boot Bin Yang, Software Engineer Open Source Technology Center, Software and Services Group (OTC/SSG) Intel Asia-Pacific Research & Development Ltd
- 2.NOTICE & DISCLAIMER • Intel technologies’ features and benefits depend on system configuration and may require enabled hardware, software or service activation. • Performance varies depending on system configuration. • Intel, the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries. • *Other names and brands may be claimed as the property of others. 2
- 3.Agenda Background Measurement Methodology and Solution 3
- 4.Background
- 5.Video for Android Boot 5
- 6.Methods for Quick Boot Normal code boot – Fundamental boot flow Resume from S3 – Similar concept to standby in laptop. – With a slight power consumption during standby. Resume from S4 – High eMMC traffic involved when going to hibernation. Impacting eMMC lifetime. 6
- 7.Focus of This Presentation ■ Normal cold boot ■ Focus on AOSP ■ No feature reduction (TEE, security boot, full disk encryption, full Android Open Source Project (AOSP*) ■ Android 6.0 7
- 8.Measurement
- 9.Measurement Bootchart Systrace Automate regression check tool 9
- 10.Methodology and Solution
- 11.AOSP* Boot Sequence Data Partition (Encrypted) Mounted Finish Preloading Finish Loading Services Init Zygote System Server System UI & Launcher UI Ready 11
- 12.Methodology and Solution Parallelization – Start Zygote ASAP – PMS Scan in Parallelization On Demand load – Preload class and resource on demand – Initialize Services Related to GUI – Split System UI Read ahead Reduce useless waiting operation 12
- 13.Zygote Start Early Coldboot Mount fs Mount encrypted dataTrigger_restart_framework Init zygote Secondary_zygote installerd Start zygote and installerd Coldboot Mount fs Mount encrypted dataTrigger_restart_framework Init zygote Secondary_zygote installerd Start zygote and installerd 13
- 14.PMS Scan in Parallel Init Zygote Use multi-threading Parse manifest PMS Apk scan Scan Use file cache Store parsed manifest in file cache. Reparse only when cache is outdated. System Server System UI & Launcher 14
- 15.Methodology and Solution Parallelization – Start Zygote ASAP – PMS Scan in Parallelization On Demand load – Preload class on demand – Initialize Services Related to GUI early – Split System UI Read ahead Reduce useless waiting operation 15
- 16.Preload Resources on Demand ART Init Preload classes Preload resource Preload OpenGL Others Fork and start SystemServer ART Init Fork and start SystemServer Preload classes Preload resource Preload OpenGL Others 16
- 17.Heap Split Image Boot.art@ space classes.oat Active Split before system server is forked Image Boot.art@ Zygot space classes.oat e Active Image Boot.art@ space classes.oat Active Image Boot.art@ Zygot space classes.oat e Active 17
- 18.Start Services Related to GUI Early System server Init all services Start systemui Start launcher System server Init services related to Gui Start systemui Start launcher Init other services 18
- 19.Split SystemUI into Two Parts SystemUI Related to GUI Follow original design Not Related to GUI Execute later 19
- 20.Methodology and Solution Parallelization – Start Zygote ASAP – PMS Scan in Parallelization On Demand load – Preload class on demand – Initialize Services Related to GUI early – Split System UI Read ahead Reduce useless waiting operation 20
- 21.Read Ahead Boot.oat/Boot.art libLLVM.so Libart.so framework-res.apk libskia.so libandroid_runtime.so libicuuc.so 21
- 22.Methodology and Solution Parallelization – Start Zygote ASAP – PMS Scan in Parallelization On Demand load – Preload class on demand – Initialize Services Related to GUI early – Split System UI Read ahead Reduce useless waiting operation 22
- 23.Reduce Useless Waiting post-fs post-fs-data Load_system_ props_action Insert defaultcrypto acti on node into end of queue Post_fs_data defaultcrypto ... persist.sys.ssr. enable_ramdu mps=1 post-fs post-fs-data Load_system_ props_action Post_fs_data load_persist_pr ops_action . persist.sys.ssr. enable_ramdu mps=1 defaultcrypto Insert defaultcrypto action node into the middle of queue 23
- 24.Q&A
- 25.