From c2e4adad52165c400f9a0ccb4cb6a0ebd4297d92 Mon Sep 17 00:00:00 2001 From: Zhao Wei Liew Date: Mon, 2 May 2016 08:48:06 +0800 Subject: msm8916: Enable cpusets ActivityManager uses this feature to assign certain tasks to certain cores, thereby improving power consumption. Change-Id: Icc02ab7720bd415af7d9f99e435a021d05bf74c8 --- board/kernel.mk | 2 ++ rootdir/etc/init.qcom.power_msm8916.rc | 6 ++++++ rootdir/etc/init.qcom.power_msm8939.rc | 6 ++++++ rootdir/etc/init.qcom.rc | 3 +++ 4 files changed, 17 insertions(+) diff --git a/board/kernel.mk b/board/kernel.mk index 0ec9a3e..802d5b0 100644 --- a/board/kernel.mk +++ b/board/kernel.mk @@ -7,6 +7,8 @@ BOARD_KERNEL_SEPARATED_DT := true BOARD_KERNEL_TAGS_OFFSET := 0x01E00000 BOARD_RAMDISK_OFFSET := 0x02000000 +ENABLE_CPUSETS := true + TARGET_KERNEL_SOURCE := kernel/cyanogen/msm8916 ifneq ($(FORCE_32_BIT),true) TARGET_KERNEL_ARCH := arm64 diff --git a/rootdir/etc/init.qcom.power_msm8916.rc b/rootdir/etc/init.qcom.power_msm8916.rc index 6be9da5..47ed84b 100644 --- a/rootdir/etc/init.qcom.power_msm8916.rc +++ b/rootdir/etc/init.qcom.power_msm8916.rc @@ -35,6 +35,12 @@ on enable-low-power # Enable low power modes write /sys/module/lpm_levels/parameters/sleep_disabled 0 + # Update foreground and background cpusets + write /dev/cpuset/foreground/cpus 0-3 + write /dev/cpuset/foreground/boost/cpus 0-3 + write /dev/cpuset/background/cpus 0 + write /dev/cpuset/system-background/cpus 0-1 + rm /data/system/perfd/default_values start perfd diff --git a/rootdir/etc/init.qcom.power_msm8939.rc b/rootdir/etc/init.qcom.power_msm8939.rc index 75329d0..37add80 100644 --- a/rootdir/etc/init.qcom.power_msm8939.rc +++ b/rootdir/etc/init.qcom.power_msm8939.rc @@ -68,6 +68,12 @@ on enable-low-power # Enable low power modes write /sys/module/lpm_levels/parameters/sleep_disabled 0 + # Update foreground and background cpusets + write /dev/cpuset/foreground/cpus 0-7 + write /dev/cpuset/foreground/boost/cpus 0-3 + write /dev/cpuset/background/cpus 4 + write /dev/cpuset/system-background/cpus 4-7 + # Per-process reclaim write /sys/module/process_reclaim/parameters/enable_process_reclaim 1 write /sys/module/process_reclaim/parameters/pressure_min 10 diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index df2e41f..09f7bcf 100644 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -345,6 +345,7 @@ service msm_irqbalance /system/bin/msm_irqbalance -f /system/vendor/etc/msm_irqb class core user root group root + writepid /dev/cpuset/system-background/tasks service netmgrd /system/bin/netmgrd class main @@ -497,6 +498,7 @@ service qcamerasvr /system/bin/mm-qcamera-daemon class late_start user camera group camera system inet input graphics + writepid /dev/cpuset/system-background/tasks # Allow usb charging to be disabled peristently on property:persist.usb.chgdisabled=1 @@ -515,6 +517,7 @@ service perfd /vendor/bin/perfd user root group root disabled + writepid /dev/cpuset/system-background/tasks service thermal-engine /vendor/bin/thermal-engine class main -- cgit v1.2.3