GSource *source;
GSList *iter;
GSList *next;
+ bool is_cpu_busy;
int ret;
/**
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);
+ cpu_boosting_level, &action_list, &is_cpu_busy);
if (ret < 0)
return G_SOURCE_REMOVE;
+ if (!is_cpu_busy)
+ break;
+
if (action_list != NULL)
break;
}
/**
+ * action_list is NULL when there is not boosted thread to decrease
+ * cpu boosting level.
+ * In addition, g_cpu_contention_handle_data_table size is 0 when
+ * there is no boosted threads yet with decreased cpu boosting level.
+ * (resourced should check whehter no more stall event during
+ * CPU_CONTENTION_HANDLE_TIMEOUT_MSEC.)
+ *
+ * In conclusion, additional timer is useless to set when action_list is
+ * empty and no decreased boosted thread.
+ */
+ if (action_list == NULL &&
+ g_hash_table_size(g_cpu_contention_handle_data_table) == 0)
+ return G_SOURCE_REMOVE;
+
+ /**
* Set timer to check whether cpu contention is alleviated or not
* after CPU_CONTENTION_HANDLE_TIMEOUT_MSEC.
*/
g_source_attach(source, cpu_boosting_context);
g_source_unref(source);
- if (action_list == NULL)
- return G_SOURCE_REMOVE;
-
gslist_for_each_safe(action_list, iter, next, input) {
assert(input);