diff options
Diffstat (limited to 'libprocessgroup/sched_policy.cpp')
-rw-r--r-- | libprocessgroup/sched_policy.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/libprocessgroup/sched_policy.cpp b/libprocessgroup/sched_policy.cpp index 1a4196a4d..03d347973 100644 --- a/libprocessgroup/sched_policy.cpp +++ b/libprocessgroup/sched_policy.cpp @@ -46,15 +46,16 @@ int set_cpuset_policy(int tid, SchedPolicy policy) { switch (policy) { case SP_BACKGROUND: - return SetTaskProfiles(tid, {"CPUSET_SP_BACKGROUND"}, true) ? 0 : -1; + return SetTaskProfiles(tid, {"CPUSET_SP_BACKGROUND", "BlkIOBackground"}, true) ? 0 : -1; case SP_FOREGROUND: + return SetTaskProfiles(tid, {"CPUSET_SP_FOREGROUND", "BlkIOForeground"}, true) ? 0 : -1; case SP_AUDIO_APP: case SP_AUDIO_SYS: - return SetTaskProfiles(tid, {"CPUSET_SP_FOREGROUND"}, true) ? 0 : -1; + return SetTaskProfiles(tid, {"CPUSET_SP_FOREGROUND", "AudioAppCapacity", "BlkIOForeground"}, true) ? 0 : -1; case SP_TOP_APP: - return SetTaskProfiles(tid, {"CPUSET_SP_TOP_APP"}, true) ? 0 : -1; + return SetTaskProfiles(tid, {"CPUSET_SP_TOP_APP", "BlkIOBackground"}, true) ? 0 : -1; case SP_SYSTEM: - return SetTaskProfiles(tid, {"CPUSET_SP_SYSTEM"}, true) ? 0 : -1; + return SetTaskProfiles(tid, {"CPUSET_SP_SYSTEM", "BlkIOForeground"}, true) ? 0 : -1; case SP_RESTRICTED: return SetTaskProfiles(tid, {"CPUSET_SP_RESTRICTED"}, true) ? 0 : -1; default: @@ -101,7 +102,7 @@ int set_sched_policy(int tid, SchedPolicy policy) { case SP_AUDIO_APP: case SP_AUDIO_SYS: case SP_TOP_APP: - SLOGD("^^^ tid %d (%s)", tid, thread_name); + SLOGD("^^^ tid %d policy %d (%s)", tid, policy, thread_name); break; case SP_SYSTEM: SLOGD("/// tid %d (%s)", tid, thread_name); @@ -117,17 +118,17 @@ int set_sched_policy(int tid, SchedPolicy policy) { switch (policy) { case SP_BACKGROUND: - return SetTaskProfiles(tid, {"SCHED_SP_BACKGROUND"}, true) ? 0 : -1; + return SetTaskProfiles(tid, {"SCHED_SP_BACKGROUND", "BlkIOBackground"}, true) ? 0 : -1; case SP_FOREGROUND: case SP_AUDIO_APP: case SP_AUDIO_SYS: - return SetTaskProfiles(tid, {"SCHED_SP_FOREGROUND"}, true) ? 0 : -1; + return SetTaskProfiles(tid, {"SCHED_SP_FOREGROUND", "BlkIOForeground"}, true) ? 0 : -1; case SP_TOP_APP: - return SetTaskProfiles(tid, {"SCHED_SP_TOP_APP"}, true) ? 0 : -1; + return SetTaskProfiles(tid, {"SCHED_SP_TOP_APP", "BlkIOForeground"}, true) ? 0 : -1; case SP_SYSTEM: return SetTaskProfiles(tid, {"SCHED_SP_SYSTEM"}, true) ? 0 : -1; case SP_RT_APP: - return SetTaskProfiles(tid, {"SCHED_SP_RT_APP"}, true) ? 0 : -1; + return SetTaskProfiles(tid, {"SCHED_SP_RT_APP", "BlkIOForeground"}, true) ? 0 : -1; default: return SetTaskProfiles(tid, {"SCHED_SP_DEFAULT"}, true) ? 0 : -1; } @@ -198,6 +199,8 @@ int get_sched_policy(int tid, SchedPolicy* policy) { *policy = SP_TOP_APP; } else if (group == "restricted") { *policy = SP_RESTRICTED; + } else if (group == "audio-app") { + *policy = SP_AUDIO_APP; } else { errno = ERANGE; return -1; |