summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Wang <wvw@google.com>2021-09-29 15:35:58 -0700
committerWei Wang <wvw@google.com>2021-10-07 17:58:44 +0000
commit7ee4980dc2eece6e9d15e41f98025f24b87506e7 (patch)
tree82bd745386fe7c6136fcabd4a05c2a9b34e4b073
parentdcdac24306cc81c70ec68905ac69e125614f2e87 (diff)
downloadcore-7ee4980dc2eece6e9d15e41f98025f24b87506e7.tar.gz
libutils: use system_background for low prio tasks in framework
Bug: 201428466 Test: Build and boot check system_server's sched group Signed-off-by: Wei Wang <wvw@google.com> Change-Id: Iffc47fdaf3ef8fba6eb01a12cf534a0393e3e91c Merged-In: Iffc47fdaf3ef8fba6eb01a12cf534a0393e3e91c
-rw-r--r--libutils/Threads.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libutils/Threads.cpp b/libutils/Threads.cpp
index 540dcf49d..6e293c741 100644
--- a/libutils/Threads.cpp
+++ b/libutils/Threads.cpp
@@ -86,8 +86,10 @@ struct thread_data_t {
// A new thread will be in its parent's sched group by default,
// so we just need to handle the background case.
+ // currently set to system_background group which is different
+ // from background group for app.
if (prio >= ANDROID_PRIORITY_BACKGROUND) {
- SetTaskProfiles(0, {"SCHED_SP_BACKGROUND"}, true);
+ SetTaskProfiles(0, {"SCHED_SP_SYSTEM"}, true);
}
if (name) {
@@ -313,7 +315,7 @@ int androidSetThreadPriority(pid_t tid, int pri)
}
if (pri >= ANDROID_PRIORITY_BACKGROUND) {
- rc = SetTaskProfiles(tid, {"SCHED_SP_BACKGROUND"}, true) ? 0 : -1;
+ rc = SetTaskProfiles(tid, {"SCHED_SP_SYSTEM"}, true) ? 0 : -1;
} else if (curr_pri >= ANDROID_PRIORITY_BACKGROUND) {
SchedPolicy policy = SP_FOREGROUND;
// Change to the sched policy group of the process.