static int cpu_boosting_governor_govern_request (
GHashTable *cpu_boosting_info_table,
cpu_boosting_level_e cpu_boosting_level,
- GSList **cpu_boosting_controller_action)
+ GSList **cpu_boosting_controller_action, bool *is_cpu_busy)
{
GHashTableIter cpu_boosting_info_iter;
resource_pid_t resource_pid;
goto error;
}
- if(!is_system_cpu_busy(BOOSTING_LEVEL_DECREASE_CPU_UTIL_THRESHOLD))
+ if (is_cpu_busy == NULL) {
+ _E("is_cpu_busy argument cannot be NULL");
+ ret = -EINVAL;
+ goto error;
+ }
+
+ /**
+ * Check cpu utilization once per a stall event.
+ * If cpu is busy at CPU_BOOSTING_LEVEL_STRONG,
+ * then find out victims to decrease cpu boosting level.
+ */
+ if (cpu_boosting_level == CPU_BOOSTING_LEVEL_STRONG
+ && !is_system_cpu_busy(BOOSTING_LEVEL_DECREASE_CPU_UTIL_THRESHOLD)) {
+ *is_cpu_busy = false;
return 0;
+ }
+
+ *is_cpu_busy = true;
hash_size = g_hash_table_size(cpu_boosting_info_table);
if (hash_size == 0)