cpu-boosting: Check whether cpu stall handler is turned on 55/298255/2 accepted/tizen/unified/20230906.014625
authorUnsung Lee <unsung.lee@samsung.com>
Fri, 1 Sep 2023 08:19:24 +0000 (17:19 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Tue, 5 Sep 2023 00:31:39 +0000 (09:31 +0900)
Check cpu stall handler is turned on.
If so, wake up cpu boosting thread to handle cpu stall.
If not, ignore event from the cpu boosting monitor.

Change-Id: Idc14a3804200291a6c4e9d021e590e98ba199e56
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
src/common/conf/cpu-common.c
src/common/conf/cpu-common.h
src/resource-optimizer/cpu/cpu-boosting.c

index f264360..56694e2 100644 (file)
@@ -25,6 +25,17 @@ static struct cpu_sched_conf *cpu_sched_conf = NULL;
 static struct cpu_affinity_conf *cpu_affinity_conf = NULL;
 static struct cpu_throttling_conf *cpu_throttling_conf = NULL;
 static struct cpu_boosting_conf *cpu_boosting_conf[CPU_BOOSTING_LEVEL_END] = {NULL, };
+static bool cpu_boosting_cpu_stall_handler_enabled = false;
+
+void cpu_boosting_enable_cpu_stall_handler(void)
+{
+       cpu_boosting_cpu_stall_handler_enabled = true;
+}
+
+bool cpu_boosting_is_enabled_of_cpu_stall_handler(void)
+{
+       return cpu_boosting_cpu_stall_handler_enabled;
+}
 
 struct cpu_sched_conf *get_cpu_sched_conf(void)
 {
index 4e4e0f1..5e3013f 100644 (file)
@@ -91,6 +91,10 @@ struct cpu_boosting_conf {
        struct cpu_sched_info cpu_sched_info;
 };
 
+void cpu_boosting_enable_cpu_stall_handler(void);
+bool cpu_boosting_is_enabled_of_cpu_stall_handler(void);
+
+
 struct cpu_sched_conf *get_cpu_sched_conf(void);
 void free_cpu_sched_conf(void);
 
index 4ce18b5..7622540 100644 (file)
@@ -382,8 +382,11 @@ void cpu_boosting_wakeup_cpu_boosting_thread(void)
         * so, the monitor should wakeup the cpu boosting main thread
         * to call governor.
         */
-       g_main_context_invoke(cpu_boosting_context,
-                       cpu_boosting_governor_govern_request, NULL);
+       if (cpu_boosting_is_enabled_of_cpu_stall_handler())
+               g_main_context_invoke(cpu_boosting_context,
+                               cpu_boosting_governor_govern_request, NULL);
+       else
+               _I("[CPU-BOOSTING] CPU stall handler is turned off");
 }
 
 static cpu_boosting_level_e cpu_boosting_level_search(struct sched_attr attr)