diff options
author | Rick Yiu <rickyiu@google.com> | 2019-03-29 20:03:47 +0800 |
---|---|---|
committer | Rick Yiu <rickyiu@google.com> | 2019-04-17 06:23:05 +0000 |
commit | 6569f35ae08b5de4323ae52be47f73e4ecb58ae1 (patch) | |
tree | 5d6caa92b47b60f1e18d950ff9a3a251cad93cd1 | |
parent | aca2bc0992045338dcc5acb21776a387431a270b (diff) | |
download | system_core-6569f35ae08b5de4323ae52be47f73e4ecb58ae1.tar.gz system_core-6569f35ae08b5de4323ae52be47f73e4ecb58ae1.tar.bz2 system_core-6569f35ae08b5de4323ae52be47f73e4ecb58ae1.zip |
Let blkio cgroup follow cpuset cgroup only
Some app may have different cgroup settings in cpuset and schedtune for its
threads, so let blkio follow cpuset only, which represents the app's current
state more accurately. Otherwise, if that thread is doing IO, then its
performance will be affected because its blkio group is in lower priority
group as schedtune.
ex: an app is now in top-app, but some thread of it set schedtune group to
background, and blkio follows schedtune because it is called later.
Main thread:
6:schedtune:/top-app
5:memory:/
4:cpuset:/top-app
3:cpuacct:/uid_1000/pid_8766
2:cpu:/
1:blkio:/
0::/
Some thread:
6:schedtune:/background
5:memory:/
4:cpuset:/top-app
3:cpuacct:/uid_1000/pid_8766
2:cpu:/
1:blkio:/background
0::/
Bug: 124727032
Test: blkio has same settings with cpuset
Change-Id: I9a140c7d9d93e1dd43c34c8cf066f4a62e2bf604
Merged-In: I9a140c7d9d93e1dd43c34c8cf066f4a62e2bf604
-rw-r--r-- | libprocessgroup/sched_policy.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/libprocessgroup/sched_policy.cpp b/libprocessgroup/sched_policy.cpp index c7d0cca4c..ab0f1ca35 100644 --- a/libprocessgroup/sched_policy.cpp +++ b/libprocessgroup/sched_policy.cpp @@ -126,24 +126,15 @@ int set_sched_policy(int tid, SchedPolicy policy) { switch (policy) { case SP_BACKGROUND: - return SetTaskProfiles(tid, {"HighEnergySaving", "LowIoPriority", "TimerSlackHigh"}) - ? 0 - : -1; + return SetTaskProfiles(tid, {"HighEnergySaving", "TimerSlackHigh"}) ? 0 : -1; case SP_FOREGROUND: case SP_AUDIO_APP: case SP_AUDIO_SYS: - return SetTaskProfiles(tid, {"HighPerformance", "HighIoPriority", "TimerSlackNormal"}) - ? 0 - : -1; + return SetTaskProfiles(tid, {"HighPerformance", "TimerSlackNormal"}) ? 0 : -1; case SP_TOP_APP: - return SetTaskProfiles(tid, {"MaxPerformance", "MaxIoPriority", "TimerSlackNormal"}) - ? 0 - : -1; + return SetTaskProfiles(tid, {"MaxPerformance", "TimerSlackNormal"}) ? 0 : -1; case SP_RT_APP: - return SetTaskProfiles(tid, - {"RealtimePerformance", "MaxIoPriority", "TimerSlackNormal"}) - ? 0 - : -1; + return SetTaskProfiles(tid, {"RealtimePerformance", "TimerSlackNormal"}) ? 0 : -1; default: return SetTaskProfiles(tid, {"TimerSlackNormal"}) ? 0 : -1; } |