resourced-cpu-boosting: Add cpu boosting governor 32/297132/11
authorUnsung Lee <unsung.lee@samsung.com>
Thu, 10 Aug 2023 09:07:21 +0000 (18:07 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Wed, 30 Aug 2023 04:51:25 +0000 (13:51 +0900)
commit78e9524da4514cda5385712d398ffa793e93fec4
tree5a652acc537fca7c26938de00b7d701fa2ceb5d0
parentc5017f4fd552b9b72ee82d6ec10e688e3f8c14c5
resourced-cpu-boosting: Add cpu boosting governor

Add cpu boosting governor in resourced plugin backend to govern
boosted thread. This function is called when CPU PSIs are triggered in resourced.
That is, cpu contention is detected in the resourced.
cpu boosting governor figures out the reason of cpu contention, and
make a list actions to handle cpu contention in cpu boosting controller.

The rule of cpu boosting governor is like below:
  - Decrease cpu boosting level of all threads having CPU_BOOSTING_LEVEL_STRONG.
    (CPU_BOOSTING_LEVEL_STRONG -> CPU_BOOSTING_LEVEL_MEDIUM)
  - Decrease cpu boosting level of all threads having CPU_BOOSTING_LEVEL_MEDIUM
    when there is no thread having CPU_BOOSTING_LEVEL_STRONG.
    (CPU_BOOSTING_LEVEL_MEDIUM -> CPU_BOOSTING_LEVEL_WEAK)

A new function called cpu boosting governor is added:
  - int cpu_boosting_governor_govern_request
(const 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: Ie86c123b6b0f78a2f64857877677b822eda45130
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
CMakeLists.txt
packaging/system-plugin-resourced-generic.spec
src/resourced-cpu-boosting/CMakeLists.txt [new file with mode: 0644]
src/resourced-cpu-boosting/resourced-cpu-boosting.c [new file with mode: 0644]