Exclude apps that are not foreground but have PROC_STATE_FOREGROUND state from
foreground cpu affinity group. cpu-sched module initially searches already
launched foreground app and move them to foreground cpu affinity grouop.
Change-Id: I3692d6a4e70c08babc5547326133099ac20ebf91
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
#include "cpu-cgroup.h"
#include "cpu-common.h"
#include "util.h"
+#include "procfs.h"
#define MOUNTS_PATH "/proc/mounts"
#define CPUSET_CGROUP "/sys/fs/cgroup/cpuset"
continue;
}
- if (cs.fg && pai->state == PROC_STATE_FOREGROUND)
+ if (cs.fg && pai->state == PROC_STATE_FOREGROUND &&
+ pai->memory.oom_score_adj < OOMADJ_BACKGRD_LOCKED)
cpu_sched_add_pid_to_cpuset(cs.fg, pai->main_pid);
}
}