conf: Add governor (post) configurations 50/299050/1 accepted/tizen/8.0/unified/20231005.093836 accepted/tizen/unified/20230920.072014 tizen_8.0_m2_release
authorUnsung Lee <unsung.lee@samsung.com>
Thu, 7 Sep 2023 03:05:33 +0000 (12:05 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Thu, 14 Sep 2023 02:35:31 +0000 (11:35 +0900)
Add memory (LMK) and cpu (boosting stall) governor configurations to
turn on/off options.

Two new section is added like below:
  - MemoryLMKGovernor in limiter.conf
    : LMK post governor related section
  - CpuBoostingStallGovernor in optimizer.conf
    : Cpu boosting stall governor related section

MemoryLMKGovernor includes configurations
  - ForegroundAppListPostGovernor: LMK post governor for foreground app list
  - WorkingSetSizePostGovernor: LMK post governor for working set size

CpuBoostingStallGovernor includes a configuration
  - CpuBoostingStallGovernor: Cpu boosting governor for stall handler

Change-Id: I901915bc6d80b66256466a54d56e9216d80f5737
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
conf/README
conf/limiter.conf
conf/optimizer.conf
src/common/conf/config-parser.c
src/common/conf/config-parser.h

index c8a770e..d36c8ea 100644 (file)
@@ -106,7 +106,21 @@ Comment: Specify the memory limitation of background apps.
          <action> can be: broadcast, reclaim, kill, ignore
 Example: BackgroundPerAppLimitAction=768MB,kill
 
-1.5 Section: CpuThrottling
+1.5 Section: MemoryLMKGovernor
+=============================
+Key: ForegroundAppListPostGovernor
+Value: (yes|1|ok|on|no|0|off)
+Comment: Specify whether LMK foregroud app list post governor is turned on or not.
+         If (yes|1|ok|on), rearrange LMK victim list according to the post governor.
+         If (no|0|off), skip the corresponding post governor.
+
+Key: WorkingSetSizePostGovernor
+Value: (yes|1|ok|on|no|0|off)
+Comment: Specify whether LMK working set size post governor is turned on or not.
+         If (yes|1|ok|on), rearrange LMK victim list according to the post governor.
+         If (no|0|off), skip the corresponding post governor.
+
+1.6 Section: CpuThrottling
 ==========================
 Key: CpuSched
 Value: <schedule scheme>
@@ -340,6 +354,14 @@ Comment: Specify the cpu rt priority when the cpu boosting level is "weak".
          <priority> is an decimal integer value.
 Example: CpuRTPriority=50
 
+2.12 Section: CpuBoostingStallGovernor
+======================================
+Key: CpuBoostingStallGovernor
+Value: (yes|1|ok|on|no|0|off)
+Comment: Specify whether cpu boosting stall governor is turned on or not.
+         If (yes|1|ok|on), decrease cpu boosting level according to the governor rule.
+         If (no|0|off), skip the corresponding governor.
+
 3. monitor.conf
 ===============
 
index bd491b6..e4deba0 100644 (file)
@@ -16,6 +16,10 @@ ServicePerAppLimitAction=128MB,kill
 [MemoryThrottling]
 ThrottlingLimit=  80%
 
+[MemoryLMKGovernor]
+ForegroundAppListPostGovernor=no
+WorkingSetSizePostGovernor=no
+
 [CpuThrottling]
 #CpuSched=idle
 #CpuNice=19
index 24ec2d7..9a1f125 100644 (file)
@@ -44,3 +44,6 @@ CpuRTPriority=1
 [CpuBoostingLevelWeak]
 CpuSched=other
 CpuNice=-20 # Priority=100
+
+[CpuBoostingStallGovernor]
+CpuBoostingStallGovernor=no
index e65dd9d..b476933 100644 (file)
@@ -32,6 +32,7 @@
 #include "compact-common.h"
 #include "cpu-common.h"
 #include "procfs.h"
+#include "memory-common.h"
 
 #define MAX_SECTION            64
 
@@ -659,6 +660,13 @@ static int optimizer_config(struct parse_result *result, void *user_data)
                        _E("[CONFIG] Unknown configuration name (%s) and value (%s) on section (%s)",
                                        result->name, result->value, result->section);
                }
+       } else if (!strncmp(result->section, CPU_BOOSTING_STALL_GOVERNOR_SECTION,
+                               strlen(CPU_BOOSTING_STALL_GOVERNOR_SECTION) + 1)) {
+               if (!strncmp(result->name, CPU_BOOSTING_STALL_GOVERNOR_NAME_CONF,
+                                       strlen(CPU_BOOSTING_STALL_GOVERNOR_NAME_CONF) + 1)) {
+                       if (config_parse_bool(result->value))
+                               cpu_boosting_enable_cpu_stall_handler();
+               }
        }
        else {
                _E("[CONFIG] Unknown section name (%s) and value (%s) on section (%s)",
@@ -800,6 +808,26 @@ static int limiter_config(struct parse_result *result, void *user_data)
 
                return error;
        }
+       else if (!strncmp(result->section, MEMORY_LMK_GOVERNOR_SECTION,
+                               strlen(MEMORY_LMK_GOVERNOR_SECTION) + 1)) {
+               int error = RESOURCED_ERROR_NONE;
+
+               if (!strncmp(result->name, FOREGROUND_APP_LIST_POST_GOVERNOR_NAME_CONF,
+                                       strlen(FOREGROUND_APP_LIST_POST_GOVERNOR_NAME_CONF) + 1)) {
+                       if (config_parse_bool(result->value))
+                               proc_enable_foreground_app_list_status();
+               } else if (!strncmp(result->name, WORKING_SET_SIZE_POST_GOVERNOR_NAME_CONF,
+                                       strlen(WORKING_SET_SIZE_POST_GOVERNOR_NAME_CONF) + 1)) {
+                       if (config_parse_bool(result->value))
+                               lmk_governor_post_enable_wss();
+               } else {
+                       _E("[CONFIG] Unknown configuration name (%s) and value (%s) "
+                                       "on section (%s)",
+                                       result->name, result->value, result->section);
+               }
+
+               return error;
+       }
        else if (!strncmp(result->section, CPU_THROTTLING_SECTION,
                                strlen(CPU_THROTTLING_SECTION)+1)) {
                if (!cpu_throttling_conf->enable)
index 3c40c0d..caec857 100644 (file)
@@ -49,6 +49,7 @@ extern "C" {
 #define MEMORY_APP_TYPE_LIMIT_SECTION       "MemoryAppTypeLimit"
 #define MEMORY_APP_STATUS_LIMIT_SECTION     "MemoryAppStatusLimit"
 #define MEMORY_THROTTLING_SECTION           "MemoryThrottling"
+#define MEMORY_LMK_GOVERNOR_SECTION         "MemoryLMKGovernor"
 #define CPU_THROTTLING_SECTION              "CpuThrottling"
 #define OLD_VIP_GROUP_SECTION               "VIP_GROUP"
 
@@ -64,6 +65,7 @@ extern "C" {
 #define CPU_BOOSTING_LEVEL_STRONG_SECTION   "CpuBoostingLevelStrong"
 #define CPU_BOOSTING_LEVEL_MEDIUM_SECTION   "CpuBoostingLevelMedium"
 #define CPU_BOOSTING_LEVEL_WEAK_SECTION     "CpuBoostingLevelWeak"
+#define CPU_BOOSTING_STALL_GOVERNOR_SECTION "CpuBoostingStallGovernor"
 
 /* process.conf */
 #define FOREGROUND_APP_LIST_SECTION         "ForegroundAppList"
@@ -92,6 +94,8 @@ extern "C" {
 #define WIDGET_PER_APP_LIMIT_ACTION_NAME_CONF        "WidgetPerAppLimitAction"
 #define GUI_PER_APP_LIMIT_ACTION_NAME_CONF           "GUIPerAppLimitAction"
 #define BACKGROUND_PER_APP_LIMIT_ACTION_NAME_CONF    "BackgroundPerAppLimitAction"
+#define FOREGROUND_APP_LIST_POST_GOVERNOR_NAME_CONF  "ForegroundAppListPostGovernor"
+#define WORKING_SET_SIZE_POST_GOVERNOR_NAME_CONF     "WorkingSetSizePostGovernor"
 
 /* CPU specific configuration name */
 #define CPU_SCHED_NAME_CONF                          "CpuSched"
@@ -126,6 +130,7 @@ extern "C" {
 #define FRAG_LEVEL_NAME_CONF                         "FragLevel"
 #define FOREGROUND_APPS_NAME_CONF                    "ForegroundApps"
 #define CPU_AFFINITY_NAME_CONF                       "CpuAffinity"
+#define CPU_BOOSTING_STALL_GOVERNOR_NAME_CONF        "CpuBoostingStallGovernor"
 
 /* configuration value */
 #define CGROUP_LOW_VALUE_CONF                        "lowest"