From 00f0aa611e2ffd0a0a11d104a78e950b37fb2538 Mon Sep 17 00:00:00 2001 From: "swift.kim" Date: Fri, 22 Feb 2019 16:55:26 +0900 Subject: [PATCH] proc-stat: Initialize pai earlier than proc_set_oom_score_adj pai structure has first to be initialized before oom score to take any effect. Change-Id: Ie58a9e0e17e2074479cb077f882eb0ee165ca7df --- src/proc-stat/proc-main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/proc-stat/proc-main.c b/src/proc-stat/proc-main.c index a902aeb..83904af 100644 --- a/src/proc-stat/proc-main.c +++ b/src/proc-stat/proc-main.c @@ -1493,10 +1493,6 @@ int resourced_proc_status_change(int status, pid_t pid, char *app_name, char *pk } break; case PROC_CGROUP_SET_LAUNCH_REQUEST: - if (apptype == PROC_TYPE_WIDGET) - proc_set_oom_score_adj(pid, OOMADJ_BACKGRD_LOCKED); - else - proc_set_oom_score_adj(pid, OOMADJ_INIT); if (!app_name) { _E("launch request: need app name! pid %d", pid); return RESOURCED_ERROR_NO_DATA; @@ -1511,6 +1507,11 @@ int resourced_proc_status_change(int status, pid_t pid, char *app_name, char *pk if (!ps.pai) break; + if (apptype == PROC_TYPE_WIDGET) + proc_set_oom_score_adj(pid, OOMADJ_BACKGRD_LOCKED); + else + proc_set_oom_score_adj(pid, OOMADJ_INIT); + if (CHECK_BIT(ps.pai->flags, PROC_VIP_ATTRIBUTE)) proc_set_oom_score_adj(pid, OOMADJ_SU); -- 2.7.4