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/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/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/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 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 50 write /sys/module/process_reclaim/parameters/per_swap_size 512 # Set lowmemorykiller tuning parameters write /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk 1 write /sys/module/lowmemorykiller/parameters/minfree "15360,19200,23040,26880,34415,43737" write /sys/module/lowmemorykiller/parameters/vmpressure_file_min 53059 # 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 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