conf: Add LmkKillException to remove app from LMK list 95/303595/1
authorUnsung Lee <unsung.lee@samsung.com>
Thu, 9 Nov 2023 11:37:01 +0000 (20:37 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Tue, 2 Jan 2024 08:45:12 +0000 (17:45 +0900)
Change-Id: I3cd92aa109185a2dbab2171230681e3ec9cf75b3
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
conf/README
src/common/conf/config-parser.c
src/common/conf/config-parser.h
src/common/proc-common.h

index 535951f..c11e050 100644 (file)
@@ -548,6 +548,16 @@ Comment: Specify whether the cpu throttling is enabled.
          If (no|0|off), disable cpu throttling.
 Example: CpuThrottling=yes
 
+Key: LmkKillException
+Value: (yes|1|ok|on|no|0|off)
+Comment: Specify whether the corresponding process is excluded from LMK victim list.
+         If (yes|1|ok|on), the process is removed from the list.
+         If (no|0|off), the process is not removed from the list.
+         Only app is supported, but service and process are not supported.
+         (system services with System, System::Privileged, and User attrs are
+         already removed from the list in LMK)
+Example: LmkKillException=yes
+
 6. optimizer.conf.d/*.conf
 ==========================
 
index 805c886..bd93f23 100644 (file)
@@ -1025,6 +1025,15 @@ static int vendor_config(struct parse_result *result, void *user_data)
                /* Enable throttling of an app (or a service) */
                pci->cpu_throttling_enable = config_parse_bool(result->value);
        }
+       else if (!strncmp(result->name, MEMORY_LMK_KILL_EXCEPTION_NAME_CONF,
+               strlen(MEMORY_LMK_KILL_EXCEPTION_NAME_CONF) + 1) && *config_type == LIMITER_CONFIG) {
+               if (!pci) {
+                       _E("process configuration information pointer should not be NULL");
+                       return RESOURCED_ERROR_FAIL;
+               }
+
+               pci->is_lmk_kill_exception = config_parse_bool(result->value);
+       }
        /* optimizer.conf.d */
        else if (!strncmp(result->name, CPU_SCHED_NAME_CONF, strlen(CPU_SCHED_NAME_CONF)+1) &&
                        *config_type == OPTIMIZER_CONFIG) {
index 4e5e703..6ce08e9 100644 (file)
@@ -99,6 +99,7 @@ extern "C" {
 #define FOREGROUND_APP_LIST_POST_GOVERNOR_NAME_CONF  "ForegroundAppListPostGovernor"
 #define WORKING_SET_SIZE_POST_GOVERNOR_NAME_CONF     "WorkingSetSizePostGovernor"
 #define MEMORY_LIMIT_TRIGGER_NAME_CONF               "MemoryLimitTrigger"
+#define MEMORY_LMK_KILL_EXCEPTION_NAME_CONF          "LmkKillException"
 
 /* CPU specific configuration name */
 #define CPU_SCHED_NAME_CONF                          "CpuSched"
index 8850791..4c8f346 100644 (file)
@@ -74,6 +74,7 @@ struct proc_conf_info {
        bool cpu_throttling_enable;
        cpu_boosting_level_e cpu_boosting_level;
        pid_t pid;
+       bool is_lmk_kill_exception;
 };
 
 enum application_type {