summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Słodczyk <m.slodczyk2@partner.samsung.com>2020-06-30 16:14:54 +0200
committerHyotaek Shim <hyotaek.shim@samsung.com>2020-07-21 11:56:50 +0000
commit618218e3d737da03946dbd2d56fcc905973efadf (patch)
tree616e596f4893de80d0fa845f0c614ec3d5027fad
parent2ae2f06041d644cee5885974be79cae50e72dada (diff)
downloadresourced-618218e3d737da03946dbd2d56fcc905973efadf.tar.gz
resourced-618218e3d737da03946dbd2d56fcc905973efadf.tar.bz2
resourced-618218e3d737da03946dbd2d56fcc905973efadf.zip
Change-Id: Id0f468171e0b9b750bfc38e5e469928e270fa60f Signed-off-by: Maciej Słodczyk <m.slodczyk2@partner.samsung.com>
-rw-r--r--src/cpu/cpu-sched.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/cpu/cpu-sched.c b/src/cpu/cpu-sched.c
index 992a051d..08b63f99 100644
--- a/src/cpu/cpu-sched.c
+++ b/src/cpu/cpu-sched.c
@@ -536,6 +536,30 @@ static void cpu_sched_free_cpusets()
cpu_sched_free_cpuset(&cs.fg);
}
+static void cpu_sched_check_apps()
+{
+ _cleanup_app_list_close_ GSList *proc_app_list = PAL_INIT_VALUE;
+ GSList *giter;
+ struct proc_app_info *pai;
+ struct coreset *c;
+
+ proc_app_list = proc_app_list_open();
+ gslist_for_each_item(giter, proc_app_list) {
+ pai = (struct proc_app_info *)giter->data;
+ if (!pai || !pai->main_pid)
+ continue;
+
+ c = cpu_sched_find_coreset(pai->appid);
+ if (NULL != c) {
+ cpu_sched_add_pid_to_cpuset(c, pai->main_pid, false);
+ continue;
+ }
+
+ if (pai->state == PROC_STATE_FOREGROUND)
+ cpu_sched_add_pid_to_cpuset(&cs.fg, pai->main_pid, true);
+ }
+}
+
static int cpu_sched_init(void *data)
{
int r;
@@ -557,6 +581,7 @@ static int cpu_sched_init(void *data)
}
cs.is_initalized = true;
+ cpu_sched_check_apps();
return RESOURCED_ERROR_NONE;
init_failed: