init.hardware.rc: disable bus-dcvs during boot

This CL will save 100ms towards system_server_ready and 200ms towards
BootComplete,  and also reduces the fluctuation per experiment.

- Enable powersaving in charger mode
- Enable bus-dcvs in boot_complete but not during boot
- Start perfd after init.power.sh completes
- Enable powerhint after perfd is started

Before
starting_zygote               : 3.4446  0.24937
nonencrypted                  : 3.678   0.23805
SystemServer_start            : 4.8719  0.25874
SystemUi_start                : 6.3992  0.36695
system_server_ready           : 6.7353  0.34765
BootAnimStopRequest           : 7.5966  0.3806
BootAnimEnd                   : 9.5259  0.399
BootComplete                  : 9.6221  0.42225

After:
starting_zygote               : 3.4261  0.22712
nonencrypted                  : 3.665   0.22334
SystemServer_start            : 4.8406  0.23445
SystemUi_start                : 6.2765  0.23754
system_server_ready           : 6.6392  0.23679
BootAnimStopRequest           : 7.7449  0.25752
BootAnimEnd                   : 9.2631  0.43299
BootComplete                  : 9.409   0.44021

Bug: 63644084
Test: 10 boot with packages/services/Car/tools/bootanalyze/bootanalyze.py
Change-Id: I975974dedea0cce23f74f15d842e7308e9797868
This commit is contained in:
Wei Wang
2017-07-20 16:01:14 -07:00
parent 9882d1d7a6
commit 1dcf62a310
4 changed files with 25 additions and 7 deletions

View File

@@ -28,7 +28,7 @@ TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
TARGET_2ND_CPU_VARIANT := cortex-a73
BOARD_KERNEL_CMDLINE += androidboot.hardware=$(TARGET_BOOTLOADER_BOARD_NAME) androidboot.console=ttyMSM0
BOARD_KERNEL_CMDLINE += androidboot.hardware=$(TARGET_BOOTLOADER_BOARD_NAME) androidboot.console=ttyMSM0 lpm_levels.sleep_disabled=1
BOARD_KERNEL_CMDLINE += user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3
BOARD_KERNEL_CMDLINE += service_locator.enable=1
BOARD_KERNEL_CMDLINE += swiotlb=2048

View File

@@ -24,6 +24,11 @@ on charger
write /sys/devices/system/cpu/cpu6/online 0
write /sys/devices/system/cpu/cpu7/online 0
wait /dev/block/bootdevice
# Enable UFS powersaving
write /sys/devices/soc/1da4000.ufshc/clkscale_enable 1
write /sys/devices/soc/1da4000.ufshc/clkgate_enable 1
write /sys/devices/soc/1da4000.ufshc/hibern8_on_idle_enable 1
write /sys/module/lpm_levels/parameters/sleep_disabled N
service charger /charger
class charger
@@ -34,10 +39,11 @@ on early-init
chmod 0755 /sys/kernel/debug
on init
# Disable UFS clk scaling
# Disable UFS powersaving
write /sys/devices/soc/1da4000.ufshc/clkscale_enable 0
write /sys/devices/soc/1da4000.ufshc/clkgate_enable 0
write /sys/devices/soc/1da4000.ufshc/hibern8_on_idle_enable 0
write /sys/module/lpm_levels/parameters/sleep_disabled Y
# Loading kernel modules in background
start insmod_sh
@@ -68,8 +74,6 @@ on init
write /sys/devices/system/cpu/cpufreq/policy4/schedutil/up_rate_limit_us 500
write /sys/devices/system/cpu/cpufreq/policy4/schedutil/down_rate_limit_us 20000
start power_sh
# set default schedTune value for foreground/top-app
write /dev/stune/foreground/schedtune.prefer_idle 1
write /dev/stune/top-app/schedtune.boost 10
@@ -141,7 +145,6 @@ on init
write /sys/module/lpm_levels/system/pwr/pwr-l2-ret/idle_enabled N
write /sys/module/lpm_levels/system/perf/perf-l2-dynret/idle_enabled N
write /sys/module/lpm_levels/system/perf/perf-l2-ret/idle_enabled N
write /sys/module/lpm_levels/parameters/sleep_disabled N
# b/37682684 Enable suspend clock reporting
write /sys/kernel/debug/clk/debug_suspend 1
@@ -245,7 +248,7 @@ on post-fs-data
# zygote need to be started after otapreopt which will be done on post-fs-data
on zygote-start
# zygote is started in common init.rc
# and now we can continue initialize /data/
# and now we can continue to initialize /data/
mkdir /data/tombstones 0771 system system
mkdir /tombstones/modem 0771 system system
mkdir /tombstones/lpass 0771 system system
@@ -456,6 +459,7 @@ service perfd /vendor/bin/perfd
user root
group root readproc system
socket perfd seqpacket 0666 root system
disabled
service thermal-engine /vendor/bin/thermal-engine -c ${sys.qcom.thermalcfg:-/vendor/etc/thermal-engine.conf}
class main
@@ -490,11 +494,19 @@ service per_proxy /vendor/bin/pm-proxy
group system
disabled
on property:sys.post_boot.parsed=1
start perfd
on property:sys.boot_completed=1
# Enable UFS clk scaling
# Enable power setting and set sys.post_boot.parsed to 1
# to start perfd
start power_sh
# Enable UFS powersaving
write /sys/devices/soc/1da4000.ufshc/clkscale_enable 1
write /sys/devices/soc/1da4000.ufshc/clkgate_enable 1
write /sys/devices/soc/1da4000.ufshc/hibern8_on_idle_enable 1
write /sys/module/lpm_levels/parameters/sleep_disabled N
# Enable ZRAM on boot_complete
swapon_all /vendor/etc/fstab.${ro.hardware}

0
init.power.sh Normal file → Executable file
View File

View File

@@ -18,6 +18,7 @@
#include <android/log.h>
#include <android-base/file.h>
#include <android-base/properties.h>
#include <android-base/strings.h>
#include <utils/Log.h>
#include "Power.h"
@@ -59,6 +60,11 @@ Return<void> Power::setInteractive(bool interactive) {
}
Return<void> Power::powerHint(PowerHint hint, int32_t data) {
if (android::base::GetProperty("init.svc.perfd", "") != "running") {
ALOGW("perfd is not started");
return Void();
}
power_hint_t h = static_cast<power_hint_t>(hint);
if (!isSupportedGovernor()) {
return Void();