android_device_lenovo_msm89.../rootdir/init.qcom.power.rc
Vijay Dandiga 3bf8f219e8 msm8937-common: post_boot: Tune/configure ZRAM memory parameters
1) Set zRam size to 1GB for 3GB and above targets
Increasing the swappiness and zRam size improves zRam savings and app concurrency.

2) Corrected the vmpressure_file_min value.

CRs-Fixed: 2176961

Change-Id: I4eb71110f35f67b984bea4106d6cec3c2586d024
2018-08-01 18:23:37 +02:00

176 lines
8.1 KiB
Text

on boot
# Set RPS mask
write /sys/class/net/rmnet0/queues/rx-0/rps_cpus 2
# Add a cpuset for the camera daemon
# we want all cores for camera
mkdir /dev/cpuset/camera-daemon
write /dev/cpuset/camera-daemon/cpus 0-7
write /dev/cpuset/camera-daemon/mems 0
chown system system /dev/cpuset/camera-daemon
chown system system /dev/cpuset/camera-daemon/tasks
chmod 0664 /dev/cpuset/camera-daemon/tasks
# Update foreground and background cpusets
# Reserve CPU 7 for the top app
write /dev/cpuset/foreground/cpus 0-6
write /dev/cpuset/foreground/boost/cpus 0-3
write /dev/cpuset/background/cpus 4-6
write /dev/cpuset/system-background/cpus 4-6
write /dev/cpuset/top-app/cpus 0-7
write /dev/cpuset/camera-daemon/cpus 4-7
on enable-low-power
# HMP scheduler settings
write /proc/sys/kernel/sched_window_stats_policy 3
write /proc/sys/kernel/sched_ravg_hist_size 3
write /proc/sys/kernel/sched_ravg_window 20000000
#disable sched_boost in 8937
write /proc/sys/kernel/sched_boost 0
# HMP Task packing settings
write /proc/sys/kernel/sched_small_task 20
write /sys/devices/system/cpu/cpu0/sched_mostly_idle_load 30
write /sys/devices/system/cpu/cpu1/sched_mostly_idle_load 30
write /sys/devices/system/cpu/cpu2/sched_mostly_idle_load 30
write /sys/devices/system/cpu/cpu3/sched_mostly_idle_load 30
write /sys/devices/system/cpu/cpu4/sched_mostly_idle_load 30
write /sys/devices/system/cpu/cpu5/sched_mostly_idle_load 30
write /sys/devices/system/cpu/cpu6/sched_mostly_idle_load 30
write /sys/devices/system/cpu/cpu7/sched_mostly_idle_load 30
write /sys/devices/system/cpu/cpu0/sched_mostly_idle_nr_run 3
write /sys/devices/system/cpu/cpu1/sched_mostly_idle_nr_run 3
write /sys/devices/system/cpu/cpu2/sched_mostly_idle_nr_run 3
write /sys/devices/system/cpu/cpu3/sched_mostly_idle_nr_run 3
write /sys/devices/system/cpu/cpu4/sched_mostly_idle_nr_run 3
write /sys/devices/system/cpu/cpu5/sched_mostly_idle_nr_run 3
write /sys/devices/system/cpu/cpu6/sched_mostly_idle_nr_run 3
write /sys/devices/system/cpu/cpu7/sched_mostly_idle_nr_run 3
write /sys/devices/system/cpu/cpu0/sched_prefer_idle 0
write /sys/devices/system/cpu/cpu1/sched_prefer_idle 0
write /sys/devices/system/cpu/cpu2/sched_prefer_idle 0
write /sys/devices/system/cpu/cpu3/sched_prefer_idle 0
write /sys/devices/system/cpu/cpu4/sched_prefer_idle 0
write /sys/devices/system/cpu/cpu5/sched_prefer_idle 0
write /sys/devices/system/cpu/cpu6/sched_prefer_idle 0
write /sys/devices/system/cpu/cpu7/sched_prefer_idle 0
write /sys/class/devfreq/soc:qcom,cpubw/governor bw_hwmon
write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/io_percent 20
write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/guard_band_mbps 30
# Disable thermal core_control to update interactive gov settings
write /sys/module/msm_thermal/core_control/enabled 0
# Enable governor for perf cluster
write /sys/devices/system/cpu/cpu0/online 1
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay "19000 1094400:39000"
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load 85
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate 20000
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq 1094400
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy 0
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads "1 960000:85 1094400:90 1344000:80"
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time 40000
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/sampling_down_factor 40000
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 960000
# Enable governor for power cluster
write /sys/devices/system/cpu/cpu4/online 1
write /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor interactive
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay 39000
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load 90
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate 20000
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq 768000
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy 0
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads "1 768000:90"
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time 40000
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/sampling_down_factor 40000
write /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq 768000
# Disable L2-GDHS low power modes
write /sys/module/lpm_levels/system/pwr/pwr-l2-gdhs/idle_enabled N
write /sys/module/lpm_levels/system/pwr/pwr-l2-gdhs/suspend_enabled N
write /sys/module/lpm_levels/system/perf/perf-l2-gdhs/idle_enabled N
write /sys/module/lpm_levels/system/perf/perf-l2-gdhs/suspend_enabled N
# Bring all cores online
write /sys/devices/system/cpu/cpu1/online 1
write /sys/devices/system/cpu/cpu2/online 1
write /sys/devices/system/cpu/cpu3/online 1
write /sys/devices/system/cpu/cpu4/online 1
write /sys/devices/system/cpu/cpu5/online 1
write /sys/devices/system/cpu/cpu6/online 1
write /sys/devices/system/cpu/cpu7/online 1
# Enable power_efficient workqueue
write /sys/module/workqueue/parameters/power_efficient 1
# Enable low power modes
write /sys/module/lpm_levels/parameters/sleep_disabled 0
# HMP scheduler (big.Little cluster related) settings
write /proc/sys/kernel/sched_upmigrate 93
write /proc/sys/kernel/sched_downmigrate 83
# Enable sched guided freq control
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load 1
write /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif 1
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_sched_load 1
write /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_migration_notif 1
write /proc/sys/kernel/sched_freq_inc_notify 50000
write /proc/sys/kernel/sched_freq_dec_notify 50000
# Enable dynamic clock gating
write /sys/module/lpm_levels/lpm_workarounds/dynamic_clock_gating 1
# Enable timer migration to little cluster
write /proc/sys/kernel/power_aware_timer_migration 1
# Set per_process_reclaim tuning parameters
write /sys/module/process_reclaim/parameters/enable_process_reclaim 1
write /sys/module/process_reclaim/parameters/pressure_max 70
write /sys/module/process_reclaim/parameters/swap_opt_eff 30
write /sys/module/process_reclaim/parameters/pressure_min 10
write /sys/module/process_reclaim/parameters/per_swap_size 1024
# Set lowmemorykiller tuning parameters
write /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk 1
write /sys/module/lowmemorykiller/parameters/minfree "18432,23040,27648,32256,55296,80640"
write /sys/module/lowmemorykiller/parameters/vmpressure_file_min 80640
# Set ZCache parameters
write /sys/module/zcache/parameters/clear_percent 3
write /sys/module/zcache/parameters/max_pool_percent 30
write /sys/block/mmcblk0/bdi/read_ahead_kb 128
write /sys/block/mmcblk0/queue/read_ahead_kb 128
write /sys/block/dm-0/queue/read_ahead_kb 128
write /sys/block/dm-1/queue/read_ahead_kb 128
# Set perfd properties
setprop sys.post_boot.parsed 1
on property:sys.boot_completed=1
trigger enable-low-power
setprop sys.io.scheduler bfq
on charger
# Offline all cores other than CPU0
write /sys/devices/system/cpu/cpu1/online 0
write /sys/devices/system/cpu/cpu2/online 0
write /sys/devices/system/cpu/cpu3/online 0
write /sys/devices/system/cpu/cpu4/online 0
write /sys/devices/system/cpu/cpu5/online 0
write /sys/devices/system/cpu/cpu6/online 0
write /sys/devices/system/cpu/cpu7/online 0
write /sys/module/lpm_levels/parameters/sleep_disabled 0
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor powersave
on property:init.svc.recovery=running
trigger enable-low-power