diff --git a/rootdir/init.rc b/rootdir/init.rc index 544269007..277a785fe 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -250,6 +250,18 @@ on init write /dev/blkio/blkio.group_idle 0 write /dev/blkio/background/blkio.group_idle 0 + # Setup cpu.shares to throttle background groups (bg ~ 5% sysbg ~ 5% dex2oat ~2.5%) + write /dev/cpuctl/background/cpu.shares 1024 + write /dev/cpuctl/system-background/cpu.shares 1024 + write /dev/cpuctl/dex2oat/cpu.shares 512 + write /dev/cpuctl/system/cpu.shares 20480 + # We only have system and background groups holding tasks and the groups below are empty + write /dev/cpuctl/camera-daemon/cpu.shares 20480 + write /dev/cpuctl/foreground/cpu.shares 20480 + write /dev/cpuctl/nnapi-hal/cpu.shares 20480 + write /dev/cpuctl/rt/cpu.shares 20480 + write /dev/cpuctl/top-app/cpu.shares 20480 + restorecon_recursive /mnt mount configfs none /config nodev noexec nosuid