cpu-boosting: Execute cpu boosting backend (governor) 27/297127/5
authorUnsung Lee <unsung.lee@samsung.com>
Thu, 10 Aug 2023 03:09:00 +0000 (12:09 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Mon, 28 Aug 2023 01:49:13 +0000 (10:49 +0900)
Execute cpu boosting governor in plugin backend to govern cpu contention.
The prototype of governor function is like below:
  - int syscommon_plugin_resourced_cpu_boosting_governor_govern_request
(GHashTable *cpu_boosting_info_table,
 cpu_boosting_level_e cpu_boosting_level,
 GSList **cpu_boosting_controller_action);
    * This function receives cpu_boosting_info_table and cpu_boosting_level
      as inputs and gives cpu_boosting_controller_action as an output.
      If return value of this function is not 0,
      then cpu_boosting_controller_action is meaningless.

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

index 458165b..fcb4cc9 100644 (file)
@@ -83,7 +83,22 @@ static void find_cpu_boosting_info_in_tables(
 
 static gboolean cpu_boosting_governor_govern_request (gpointer user_data)
 {
-       return FALSE;
+       GSList *action_list = NULL;
+       int ret;
+
+       for (cpu_boosting_level_e cpu_boosting_level = CPU_BOOSTING_LEVEL_STRONG;
+                       cpu_boosting_level < CPU_BOOSTING_LEVEL_END; cpu_boosting_level++) {
+               ret = syscommon_plugin_resourced_cpu_boosting_governor_govern_request(
+                               g_cpu_boosting_info_table[cpu_boosting_level],
+                               cpu_boosting_level, &action_list);
+               if (ret < 0)
+                       return G_SOURCE_REMOVE;
+       }
+
+       if (action_list == NULL)
+               return G_SOURCE_REMOVE;
+
+       return G_SOURCE_REMOVE;
 }
 
 void cpu_boosting_wakeup_cpu_boosting_thread(void)