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;
}
cs.is_initalized = true;
+ cpu_sched_check_apps();
return RESOURCED_ERROR_NONE;
init_failed: