aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidevinavil <davidevinavil@gmail.com>2017-01-11 22:57:11 +0100
committerdavidevinavil <davidevinavil@gmail.com>2017-01-14 15:53:03 +0100
commit76883269636f2bf42751abab054e61af42468dcd (patch)
tree250fe62497d76fe8238c8e5d476113ed68018ff7
parent2ed8f7af97cee840060894abdaa7fe1d40afe4a9 (diff)
z2_plus: Update cpuset
Change-Id: Ifd30e5145c10c6a2c2a6a11411a315c162b03a50
-rwxr-xr-xBoardConfig.mk2
-rwxr-xr-xrootdir/etc/init.qcom.power.rc59
2 files changed, 53 insertions, 8 deletions
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 846a8b3..a0502e6 100755
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -69,7 +69,7 @@ TARGET_KERNEL_APPEND_DTB := true
TARGET_KERNEL_ARCH := arm64
TARGET_KERNEL_HEADER_ARCH := arm64
TARGET_KERNEL_CROSS_COMPILE_PREFIX := aarch64-linux-android-
-TARGET_KERNEL_CONFIG := cyanogenmod_z2_plus_defconfig
+TARGET_KERNEL_CONFIG := cyanogenmod_z2_defconfig
TARGET_KERNEL_SOURCE := kernel/zuk/msm8996
# QCOM hardware
diff --git a/rootdir/etc/init.qcom.power.rc b/rootdir/etc/init.qcom.power.rc
index fe2351f..50ba17e 100755
--- a/rootdir/etc/init.qcom.power.rc
+++ b/rootdir/etc/init.qcom.power.rc
@@ -1,11 +1,56 @@
-on boot
- # 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-3
- write /dev/cpuset/system-background/cpus 0-3
- write /dev/cpuset/top-app/cpus 0-3
+on init
+ # sets up initial cpusets for ActivityManager
+ mkdir /dev/cpuset
+ mount cpuset none /dev/cpuset
+
+ # this ensures that the cpusets are present and usable, but the device's
+ # init.rc must actually set the correct cpus
+ mkdir /dev/cpuset/foreground
+ write /dev/cpuset/foreground/cpus 0
+ write /dev/cpuset/foreground/mems 0
+ mkdir /dev/cpuset/foreground/boost
+ write /dev/cpuset/foreground/boost/cpus 0
+ write /dev/cpuset/foreground/boost/mems 0
+ mkdir /dev/cpuset/background
+ write /dev/cpuset/background/cpus 0
+ write /dev/cpuset/background/mems 0
+
+ # system-background is for system tasks that should only run on
+ # little cores, not on bigs
+ # to be used only by init, so don't change system-bg permissions
+ mkdir /dev/cpuset/system-background
+ write /dev/cpuset/system-background/cpus 0
+ write /dev/cpuset/system-background/mems 0
+
+ mkdir /dev/cpuset/top-app
+ write /dev/cpuset/top-app/cpus 0
+ write /dev/cpuset/top-app/mems 0
+
+ # change permissions for all cpusets we'll touch at runtime
+ chown system system /dev/cpuset
+ chown system system /dev/cpuset/foreground
+ chown system system /dev/cpuset/foreground/boost
+ chown system system /dev/cpuset/background
+ chown system system /dev/cpuset/system-background
+ chown system system /dev/cpuset/top-app
+ chown system system /dev/cpuset/tasks
+ chown system system /dev/cpuset/foreground/tasks
+ chown system system /dev/cpuset/foreground/boost/tasks
+ chown system system /dev/cpuset/background/tasks
+ chown system system /dev/cpuset/system-background/tasks
+ chown system system /dev/cpuset/top-app/tasks
+
+ # set system-background to 0775 so SurfaceFlinger can touch it
+ chmod 0775 /dev/cpuset/system-background
+
+ chmod 0664 /dev/cpuset/foreground/tasks
+ chmod 0664 /dev/cpuset/foreground/boost/tasks
+ chmod 0664 /dev/cpuset/background/tasks
+ chmod 0664 /dev/cpuset/system-background/tasks
+ chmod 0664 /dev/cpuset/top-app/tasks
+ chmod 0664 /dev/cpuset/tasks
+on boot
# Enable sched boost
write /proc/sys/kernel/sched_boost 1