lowmem: Pass oom level to LMK governor post for fg app 35/296335/7
authorUnsung Lee <unsung.lee@samsung.com>
Tue, 25 Jul 2023 11:38:12 +0000 (20:38 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 31 Jul 2023 02:40:07 +0000 (02:40 +0000)
LMK governor post function reordering foreground status app candidates
requires oom level, so pass oom level to this post function.

LMK governor post function reordering foreground status app candidates
needs to know oom level to judge whether all candidates are
from foreground app or not.

Change-Id: I3fad91585db910a39dc5e9ccdc52b22e5401f66d
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
src/resource-limiter/memory/lowmem.c

index dc9a730..7f33541 100644 (file)
@@ -712,8 +712,9 @@ void lowmem_register_lmk_controller(int(*kill_candidates)(GArray *, unsigned,
  * @threshold:         desired value of memory available
  */
 static int lowmem_kill_victims(int max_victims,
-       int start_oom, int end_oom, unsigned should_be_freed, int flags,
-       unsigned int *total_size, int *completed, unsigned int threshold)
+               enum syscommon_resourced_memory_lmk_oom_level oom_level,
+               int start_oom, int end_oom, unsigned should_be_freed, int flags,
+               unsigned int *total_size, int *completed, unsigned int threshold)
 {
        int ret;
        unsigned int total_victim_size = 0;
@@ -767,7 +768,7 @@ static int lowmem_kill_victims(int max_victims,
        }
 
        ret = syscommon_plugin_resourced_memory_lmk_get_kill_candidates_post_with_foreground(
-                               lowmem_kill_candidates);
+                               lowmem_kill_candidates, oom_level);
        if (ret < 0) {
                status = LOWMEM_RECLAIM_NEXT_TYPE;
                goto leave;
@@ -908,7 +909,7 @@ retry:
 
        /* precaution */
        current_size = 0;
-       victim_cnt = lowmem_kill_victims(max_victim_cnt, start_oom, end_oom,
+       victim_cnt = lowmem_kill_victims(max_victim_cnt, oom_level, start_oom, end_oom,
                            reclaim_size_mb, ctl->flags, &current_size, &status, ctl->size_mb);
 
        if (victim_cnt) {