From 73e355409a7ff004cc86c312b2d5362d9423d621 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Tue, 27 Aug 2019 20:19:36 -0700 Subject: [PATCH] Let blkio cgroup follow sched_policy This reverts commit e8678cf883ee78ab9fe5ea47e6d9b24ef7c8d4f7. With b/131214885 resolved, we should reland the change for bg sched group. If a thread explicitly calls set_sched_policy to set a thread to background, it should not be latency sensitive. This would help background I/O impacting foreground I/O e.g. b/65727988 Test: build and boot Bug: 140209629 Change-Id: I218db084fb733cad57af8a5eae926818a6a2cdb8 --- libprocessgroup/sched_policy.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/libprocessgroup/sched_policy.cpp b/libprocessgroup/sched_policy.cpp index 15f8139b1..c83df1aa6 100644 --- a/libprocessgroup/sched_policy.cpp +++ b/libprocessgroup/sched_policy.cpp @@ -134,15 +134,27 @@ int set_sched_policy(int tid, SchedPolicy policy) { switch (policy) { case SP_BACKGROUND: - return SetTaskProfiles(tid, {"HighEnergySaving", "TimerSlackHigh"}, true) ? 0 : -1; + return SetTaskProfiles(tid, {"HighEnergySaving", "LowIoPriority", "TimerSlackHigh"}, + true) + ? 0 + : -1; case SP_FOREGROUND: case SP_AUDIO_APP: case SP_AUDIO_SYS: - return SetTaskProfiles(tid, {"HighPerformance", "TimerSlackNormal"}, true) ? 0 : -1; + return SetTaskProfiles(tid, {"HighPerformance", "HighIoPriority", "TimerSlackNormal"}, + true) + ? 0 + : -1; case SP_TOP_APP: - return SetTaskProfiles(tid, {"MaxPerformance", "TimerSlackNormal"}, true) ? 0 : -1; + return SetTaskProfiles(tid, {"MaxPerformance", "MaxIoPriority", "TimerSlackNormal"}, + true) + ? 0 + : -1; case SP_RT_APP: - return SetTaskProfiles(tid, {"RealtimePerformance", "TimerSlackNormal"}, true) ? 0 : -1; + return SetTaskProfiles( + tid, {"RealtimePerformance", "MaxIoPriority", "TimerSlackNormal"}, true) + ? 0 + : -1; default: return SetTaskProfiles(tid, {"TimerSlackNormal"}, true) ? 0 : -1; }