From e2864c28a55a8d066473204e7375ed434bb4cce8 Mon Sep 17 00:00:00 2001 From: Chitti Babu Theegala Date: Thu, 4 Sep 2014 20:00:52 +0530 Subject: [PATCH] post_boot.sh: Interactive settings for 8916, 8936 and 8939 Apply interactive governor settings for 8916, 8936 and 8939 Change-Id: Id6ce05e0e4fa356b6d2fa3271ee58d3bbce000ec --- rootdir/etc/init.qcom.post_boot.sh | 99 ++++++++++++++++++++++++------ 1 file changed, 79 insertions(+), 20 deletions(-) diff --git a/rootdir/etc/init.qcom.post_boot.sh b/rootdir/etc/init.qcom.post_boot.sh index 27bea5ee..d52103ee 100755 --- a/rootdir/etc/init.qcom.post_boot.sh +++ b/rootdir/etc/init.qcom.post_boot.sh @@ -1,5 +1,5 @@ #!/system/bin/sh -# Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. +# Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -456,13 +456,18 @@ esac case "$target" in "msm8916") - if [ -f /sys/devices/soc0/soc_id ]; then + + if [ -f /sys/devices/soc0/soc_id ]; then soc_id=`cat /sys/devices/soc0/soc_id` else soc_id=`cat /sys/devices/system/soc/soc0/id` fi - # Apply HMP Task packing for 8916, 8936 and 8939 + # HMP scheduler settings for 8916, 8936, 8939 + echo 2 > /proc/sys/kernel/sched_window_stats_policy + echo 3 > /proc/sys/kernel/sched_ravg_hist_size + + # HMP Task packing settings for 8916, 8936, 8939 echo 30 > /proc/sys/kernel/sched_small_task echo 50 > /proc/sys/kernel/sched_mostly_idle_load echo 10 > /proc/sys/kernel/sched_mostly_idle_nr_run @@ -470,56 +475,110 @@ case "$target" in # Apply governor settings for 8916 case "$soc_id" in "206") + + # disable thermal core_control to update scaling_min_freq + echo 0 > /sys/module/msm_thermal/core_control/enabled + echo 1 > /sys/devices/system/cpu/cpu0/online echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + echo 800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + # enable thermal core_control now + echo 1 > /sys/module/msm_thermal/core_control/enabled + echo "25000 1094400:50000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay echo 90 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load echo 25000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate echo 998400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq echo 0 > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy - echo "85 998400:90 1094400:80" > /sys/devices/system/cpu/cpufreq/interactive/target_loads + echo "1 800000:85 998400:90 1094400:80" > /sys/devices/system/cpu/cpufreq/interactive/target_loads echo 50000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time echo 50000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor + + # Bring up all cores online + echo 1 > /sys/devices/system/cpu/cpu1/online + echo 1 > /sys/devices/system/cpu/cpu2/online + echo 1 > /sys/devices/system/cpu/cpu3/online + echo 1 > /sys/devices/system/cpu/cpu4/online + ;; + esac + + # Apply governor settings for 8936 + case "$soc_id" in + "233") + + # disable thermal core_control to update scaling_min_freq, interactive gov + echo 0 > /sys/module/msm_thermal/core_control/enabled + echo 1 > /sys/devices/system/cpu/cpu0/online + echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + # enable thermal core_control now + echo 1 > /sys/module/msm_thermal/core_control/enabled + + echo "25000 1113600:50000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay + echo 90 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load + echo 25000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate + echo 960000 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq + echo 0 > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy + echo "1 800000:85 1113600:90 1267200:80" > /sys/devices/system/cpu/cpufreq/interactive/target_loads + echo 50000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time + echo 50000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor + + # Bring up all cores online + echo 1 > /sys/devices/system/cpu/cpu1/online + echo 1 > /sys/devices/system/cpu/cpu2/online + echo 1 > /sys/devices/system/cpu/cpu3/online + echo 1 > /sys/devices/system/cpu/cpu4/online ;; esac # Apply governor settings for 8939 case "$soc_id" in - "239" | "241" ) - for devfreq_gov in /sys/class/devfreq/qcom,cpubw*/governor - do - echo "bw_hwmon" > $devfreq_gov - done + "239" | "241" ) + + # disable thermal core_control to update interactive gov settings + echo 0 > /sys/module/msm_thermal/core_control/enabled + # enable governor for perf cluster + echo 1 > /sys/devices/system/cpu/cpu0/online echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor - echo "25000 800000:50000" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay + echo "25000 1113600:50000" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load echo 25000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate - echo 800000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq + echo 960000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy - echo "85 800000:90" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads + echo "1 800000:85 1113600:90 1267200:80" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads echo 50000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time echo 50000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/sampling_down_factor - echo 400000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + echo 800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + # enable governor for power cluster + echo 1 > /sys/devices/system/cpu/cpu4/online echo "interactive" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor - echo "25000 499200:50000" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay + echo "25000 800000:50000" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay echo 90 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load echo 25000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate - echo 499200 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq + echo 800000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy - echo "85 499200:90" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads + echo "1 499200:85 800000:90" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads echo 50000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time echo 50000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/sampling_down_factor - echo 249600 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq + echo 499200 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq + + # enable thermal core_control now + echo 1 > /sys/module/msm_thermal/core_control/enabled + + # Bring up all cores online echo 1 > /sys/devices/system/cpu/cpu1/online - echo 1 > /sys/devices/system/cpu/cpu2/online + echo 1 > /sys/devices/system/cpu/cpu2/online echo 1 > /sys/devices/system/cpu/cpu3/online - echo 1 > /sys/devices/system/cpu/cpu4/online + echo 1 > /sys/devices/system/cpu/cpu4/online echo 1 > /sys/devices/system/cpu/cpu5/online echo 1 > /sys/devices/system/cpu/cpu6/online echo 1 > /sys/devices/system/cpu/cpu7/online - ;; + + # HMP scheduler (big.Little cluster related) settings + echo 60 > /proc/sys/kernel/sched_upmigrate + echo 40 > /proc/sys/kernel/sched_downmigrate + ;; esac ;; esac