init: Throttle background group utilization at 5%

* taken from pixels

Change-Id: Icfd60e716f189670dcf11aab434bbe043c94be0a
Signed-off-by: minaripenguin <minaripenguin@users.noreply.github.com>
This commit is contained in:
minaripenguin 2024-02-07 17:56:11 +08:00 committed by Fazil Sheik
parent b53ebe510e
commit ed8b5853a6
1 changed files with 12 additions and 0 deletions

View File

@ -250,6 +250,18 @@ on init
write /dev/blkio/blkio.group_idle 0 write /dev/blkio/blkio.group_idle 0
write /dev/blkio/background/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 restorecon_recursive /mnt
mount configfs none /config nodev noexec nosuid mount configfs none /config nodev noexec nosuid