#include <libsyscommon/log.h>
#define BOOSTING_LEVEL_DECREASE_CPU_UTIL_THRESHOLD 99.0
+#define BOOSTING_LEVEL_RESTORE_CPU_UTIL_THRESHOLD 90.0
#define EXPORT __attribute__ ((visibility("default")))
return true;
}
+static bool is_cpu_contention_alleviated(guint timer_id, guint latest_timer_id)
+{
+ /**
+ * If additional monitor events are not triggered
+ * for interval, then restore CPU boosting level.
+ */
+ if (timer_id != latest_timer_id)
+ return false;
+
+ if (is_system_cpu_busy(BOOSTING_LEVEL_RESTORE_CPU_UTIL_THRESHOLD))
+ return false;
+
+ return true;
+}
+
static int cpu_boosting_governor_govern_request (
GHashTable *cpu_boosting_info_table,
cpu_boosting_level_e cpu_boosting_level,
static syscommon_plugin_backend_resourced_cpu_boosting_funcs g_cpu_boosting_funcs = {
.cpu_boosting_governor_govern_request = cpu_boosting_governor_govern_request,
+ .is_cpu_contention_alleviated = is_cpu_contention_alleviated,
};
syscommon_plugin_backend EXPORT system_plugin_backend_resourced_cpu_boosting_data = {