From 6d4c63e896f6eb5a7a4c98b5a566cd13a7cac810 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Wed, 10 Mar 2021 23:00:02 -0800 Subject: [PATCH] P21: enable throttle background group at 5% Right now we have many groups due to uclamp setup, and this would potentially create interesting fairness between groups. Ultimately we want only a system group and a background group for cpu.shares, which would achieve after b/182509410 resolved. Test: boot and check setting Bug: 171740453 Change-Id: I8fa23268aa7ed02dcccc527abcec8556009aa9a7 --- conf/init.gs101.rc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/conf/init.gs101.rc b/conf/init.gs101.rc index 62d67eab..abe67ca0 100644 --- a/conf/init.gs101.rc +++ b/conf/init.gs101.rc @@ -634,6 +634,17 @@ on property:sys.boot_completed=1 write /sys/kernel/vendor_sched/ta_uclamp_min 103 write /sys/kernel/vendor_sched/fg_uclamp_min 0 + # Setup cpu.shares to throttle background group at 5% + write /dev/cpuctl/background/cpu.shares 1024 + 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/system-background/cpu.shares 20480 + write /dev/cpuctl/top-app/cpu.shares 20480 + # gvotables for dumpstate chown system system /sys/kernel/debug/gvotables