plugin-api: resourced: Add lmk_try_count in get_kill_candidates_post_with_wss 78/298378/2 accepted/tizen/unified/20230907.175321
authorUnsung Lee <unsung.lee@samsung.com>
Tue, 5 Sep 2023 02:24:00 +0000 (11:24 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 6 Sep 2023 23:59:57 +0000 (23:59 +0000)
resourced-lmk-governor needs to know the number of killing cycle.
This is because, the governor should know whether
memory thrasing happens or not. If lowmem state is not recovered during the
threshold cycle, then the governor skips working set size calculation and
does not give benefit to apps with effcient memory usage.

Change-Id: I4ba581d10b967665ae3155205cba9b30b0e3fa6b
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
src/plugin-api/resourced/include/system/syscommon-plugin-resourced-memory-lmk-interface.h
src/plugin-api/resourced/include/system/syscommon-plugin-resourced-memory-lmk.h
src/plugin-api/resourced/src/syscommon-plugin-resourced-memory-lmk.c

index e14f60a455fa48a1cc27dcc03ba68e306ea0f0db..73578aad812d6c73109f9b8dd32d9d01daa7c9fc 100644 (file)
@@ -100,7 +100,7 @@ typedef struct _syscommon_plugin_backend_resourced_memory_lmk_funcs {
                                GArray *task_info_proc_array,
                                unsigned long totalram_kb);
        int (*get_kill_candidates_post)(GArray *candidates);
-       int (*get_kill_candidates_post_with_wss)(GArray *candidates);
+       int (*get_kill_candidates_post_with_wss)(GArray *candidates, int lmk_try_count);
        int (*get_kill_candidates_post_with_foreground)(GArray *candidates,
                        enum syscommon_resourced_memory_lmk_oom_level oom_level);
 } syscommon_plugin_backend_resourced_memory_lmk_funcs;
index b2ac1b0e4ccb1cd22ce90c4aba9c17494b3391ae..66525b1f644a0520754143b30385a5f0300dd861 100644 (file)
@@ -77,11 +77,12 @@ int syscommon_plugin_resourced_memory_lmk_get_kill_candidates_post(
           according to working set size rule
  * @param[in] candidates is a GArray to return kill candidates, it is already
               sorted by get_kill_candidates
+ * @param[in] lmk_try_count is the number of LMK in a event
  * @return @c zero on success,
  *            otherwise a negative error value
  */
 int syscommon_plugin_resourced_memory_lmk_get_kill_candidates_post_with_wss(
-               GArray *candidates);
+               GArray *candidates, int lmk_try_count);
 
 /**
  * @brief Reorder candidates list sorted first by get_kill_candidates fuction
index 6ccb8b2a85b8e038f0c2a058cdc75f82aefc53da..c5fe92fd970b795757b362febf4f84543bdd3c81 100644 (file)
@@ -128,7 +128,7 @@ int syscommon_plugin_resourced_memory_lmk_get_kill_candidates_post(
 
 EXPORT
 int syscommon_plugin_resourced_memory_lmk_get_kill_candidates_post_with_wss(
-               GArray *candidates)
+               GArray *candidates, int lmk_try_count)
 {
        int ret = 0;
 
@@ -144,7 +144,7 @@ int syscommon_plugin_resourced_memory_lmk_get_kill_candidates_post_with_wss(
                return -ENOTSUP;
        }
 
-       return funcs->get_kill_candidates_post_with_wss(candidates);
+       return funcs->get_kill_candidates_post_with_wss(candidates, lmk_try_count);
 }
 
 EXPORT