conf: Add LmkKillException to remove app from LMK list 29/301329/6
authorUnsung Lee <unsung.lee@samsung.com>
Thu, 9 Nov 2023 11:37:01 +0000 (20:37 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Tue, 21 Nov 2023 07:56:06 +0000 (16:56 +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 696540f0aa32e8aaade9ceb0984c246ecd475f76..accbc39e109e10c10b8cad558977319def0aa532 100644 (file)
@@ -515,6 +515,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 8bdf9e097369246413b65de99db820b5f7ee2285..7273802d59b6236d89a43d53517c0f3b3aa8be2a 100644 (file)
@@ -889,6 +889,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 e9907c5c803a24817f2364443423fb5e547a3eed..1a1af00b5ff201a13188e07516a2d73ced08d2ae 100644 (file)
@@ -87,6 +87,7 @@ extern "C" {
 #define GUI_PER_APP_LIMIT_ACTION_NAME_CONF           "GUIPerAppLimitAction"
 #define BACKGROUND_PER_APP_LIMIT_ACTION_NAME_CONF    "BackgroundPerAppLimitAction"
 #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 77ae47e2829c8a9a58b1be76f30b68502eb28b27..e04731f897750168186fbf45b9051213d798c5fd 100644 (file)
@@ -73,6 +73,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 {