From c07f0071360337731b37a5659b3016bcf519ed2a Mon Sep 17 00:00:00 2001 From: Unsung Lee Date: Mon, 4 Sep 2023 15:36:47 +0900 Subject: [PATCH] plugin-api: resourced: Add is_cpu_busy argument into govenor func Add is_cpu_busy argument into syscommon_plugin_resourced_cpu_boosting_governor_govern_request() function to check whether system cpu is busy or not. If system cpu is not busy, then resourced cpu boosting will ignore stall event immediately. Function called cpu boosting governor is modified: - 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, bool *is_cpu_busy); * output argument called is_cpu_busy is added. Change-Id: I0827f4b5ac5ffec8c64f34c124e89176e24a6c3c Signed-off-by: Unsung Lee --- .../system/syscommon-plugin-resourced-cpu-boosting-interface.h | 2 +- .../include/system/syscommon-plugin-resourced-cpu-boosting.h | 3 ++- .../resourced/src/syscommon-plugin-resourced-cpu-boosting.c | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugin-api/resourced/include/system/syscommon-plugin-resourced-cpu-boosting-interface.h b/src/plugin-api/resourced/include/system/syscommon-plugin-resourced-cpu-boosting-interface.h index 73c0c40..72fefd0 100644 --- a/src/plugin-api/resourced/include/system/syscommon-plugin-resourced-cpu-boosting-interface.h +++ b/src/plugin-api/resourced/include/system/syscommon-plugin-resourced-cpu-boosting-interface.h @@ -52,7 +52,7 @@ typedef struct _syscommon_plugin_backend_resourced_cpu_boosting_funcs { 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); bool (*is_cpu_contention_alleviated) (guint timer_id, guint latest_timer_id); } syscommon_plugin_backend_resourced_cpu_boosting_funcs; diff --git a/src/plugin-api/resourced/include/system/syscommon-plugin-resourced-cpu-boosting.h b/src/plugin-api/resourced/include/system/syscommon-plugin-resourced-cpu-boosting.h index 598ccbd..e337bd8 100644 --- a/src/plugin-api/resourced/include/system/syscommon-plugin-resourced-cpu-boosting.h +++ b/src/plugin-api/resourced/include/system/syscommon-plugin-resourced-cpu-boosting.h @@ -52,13 +52,14 @@ int syscommon_plugin_resourced_cpu_boosting_put_backend(void); * CPU_BOOSTING_LEVEL_MEDIUM, and CPU_BOOSTING_LEVEL_WEAK * @param[out] cpu_boosting_controller_action is a GSList containing actions * to be taken by cpu boosting controller + * @param[out] is_cpu_busy is a bool info whehter system cpu is busy or not * @return @c zero on success, * otherwise a negative error value */ 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); + GSList **cpu_boosting_controller_action, bool *is_cpu_busy); /** * @brief Check whehter cpu contention is alleviated diff --git a/src/plugin-api/resourced/src/syscommon-plugin-resourced-cpu-boosting.c b/src/plugin-api/resourced/src/syscommon-plugin-resourced-cpu-boosting.c index 4d6739b..79bbe5c 100644 --- a/src/plugin-api/resourced/src/syscommon-plugin-resourced-cpu-boosting.c +++ b/src/plugin-api/resourced/src/syscommon-plugin-resourced-cpu-boosting.c @@ -82,7 +82,7 @@ EXPORT 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) + GSList **cpu_boosting_controller_action, bool *is_cpu_busy) { int ret = 0; @@ -100,7 +100,8 @@ int syscommon_plugin_resourced_cpu_boosting_governor_govern_request( } return funcs->cpu_boosting_governor_govern_request(cpu_boosting_info_table, - cpu_boosting_level, cpu_boosting_controller_action); + cpu_boosting_level, cpu_boosting_controller_action, + is_cpu_busy); } EXPORT -- 2.7.4