diff options
author | Suren Baghdasaryan <surenb@google.com> | 2019-04-22 16:08:34 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-04-22 16:08:34 +0000 |
commit | 1a043459a93192d52ef03ca730cfafccda1d227d (patch) | |
tree | d205e24b5c1ba222dddd8bd340b88171500632dc /libprocessgroup/sched_policy.cpp | |
parent | 1412f3c99de746c13ee35f19df514863b888eeb8 (diff) | |
parent | 8a315d2a3eb65d39f98f639565f7a29196f5e7bd (diff) |
Merge "Re-enable file descriptor caching and add option to skip caching"
Diffstat (limited to 'libprocessgroup/sched_policy.cpp')
-rw-r--r-- | libprocessgroup/sched_policy.cpp | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/libprocessgroup/sched_policy.cpp b/libprocessgroup/sched_policy.cpp index ab0f1ca35..fe4f93b1e 100644 --- a/libprocessgroup/sched_policy.cpp +++ b/libprocessgroup/sched_policy.cpp @@ -46,26 +46,34 @@ int set_cpuset_policy(int tid, SchedPolicy policy) { switch (policy) { case SP_BACKGROUND: - return SetTaskProfiles(tid, {"HighEnergySaving", "ProcessCapacityLow", "LowIoPriority", - "TimerSlackHigh"}) + return SetTaskProfiles(tid, + {"HighEnergySaving", "ProcessCapacityLow", "LowIoPriority", + "TimerSlackHigh"}, + true) ? 0 : -1; case SP_FOREGROUND: case SP_AUDIO_APP: case SP_AUDIO_SYS: - return SetTaskProfiles(tid, {"HighPerformance", "ProcessCapacityHigh", "HighIoPriority", - "TimerSlackNormal"}) + return SetTaskProfiles(tid, + {"HighPerformance", "ProcessCapacityHigh", "HighIoPriority", + "TimerSlackNormal"}, + true) ? 0 : -1; case SP_TOP_APP: - return SetTaskProfiles(tid, {"MaxPerformance", "ProcessCapacityMax", "MaxIoPriority", - "TimerSlackNormal"}) + return SetTaskProfiles(tid, + {"MaxPerformance", "ProcessCapacityMax", "MaxIoPriority", + "TimerSlackNormal"}, + true) ? 0 : -1; case SP_SYSTEM: - return SetTaskProfiles(tid, {"ServiceCapacityLow", "TimerSlackNormal"}) ? 0 : -1; + return SetTaskProfiles(tid, {"ServiceCapacityLow", "TimerSlackNormal"}, true) ? 0 : -1; case SP_RESTRICTED: - return SetTaskProfiles(tid, {"ServiceCapacityRestricted", "TimerSlackNormal"}) ? 0 : -1; + return SetTaskProfiles(tid, {"ServiceCapacityRestricted", "TimerSlackNormal"}, true) + ? 0 + : -1; default: break; } @@ -126,17 +134,17 @@ int set_sched_policy(int tid, SchedPolicy policy) { switch (policy) { case SP_BACKGROUND: - return SetTaskProfiles(tid, {"HighEnergySaving", "TimerSlackHigh"}) ? 0 : -1; + return SetTaskProfiles(tid, {"HighEnergySaving", "TimerSlackHigh"}, true) ? 0 : -1; case SP_FOREGROUND: case SP_AUDIO_APP: case SP_AUDIO_SYS: - return SetTaskProfiles(tid, {"HighPerformance", "TimerSlackNormal"}) ? 0 : -1; + return SetTaskProfiles(tid, {"HighPerformance", "TimerSlackNormal"}, true) ? 0 : -1; case SP_TOP_APP: - return SetTaskProfiles(tid, {"MaxPerformance", "TimerSlackNormal"}) ? 0 : -1; + return SetTaskProfiles(tid, {"MaxPerformance", "TimerSlackNormal"}, true) ? 0 : -1; case SP_RT_APP: - return SetTaskProfiles(tid, {"RealtimePerformance", "TimerSlackNormal"}) ? 0 : -1; + return SetTaskProfiles(tid, {"RealtimePerformance", "TimerSlackNormal"}, true) ? 0 : -1; default: - return SetTaskProfiles(tid, {"TimerSlackNormal"}) ? 0 : -1; + return SetTaskProfiles(tid, {"TimerSlackNormal"}, true) ? 0 : -1; } return 0; |