Remove timeout setting of applying cpu boosting 27/297427/2
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 18 Aug 2023 05:01:18 +0000 (14:01 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 18 Aug 2023 05:01:32 +0000 (14:01 +0900)
Unfortunately, the plugin module of the resource API does not support
timeout feature properly. According to the guide, if the timeout setting
exists, we must not call the resource_clear_cpu_boosting() function.
This patch changes the timeout argument to -1 from the 5000 (milliseconds).
The RESET_ON_FORK flag is also removed.

Change-Id: I390c5ec3dd6f8ae0d5ac87303e1378ba17411f68
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/lib/amd_main.cc
src/lib/common/cpu_boost_controller.cc

index 14669c7..5bbfbeb 100644 (file)
@@ -254,7 +254,7 @@ static gboolean TimeoutCb(gpointer user_data) {
 
 extern "C" EXPORT int amd_main(int argc, char** argv) {
   amd::CPUBoostController::DoBoost(getpid(),
-      amd::CPUBoostController::Level::Strong, 10000);
+      amd::CPUBoostController::Level::Strong, -1);
   if (Initialize() != 0) {
     _E("AMD initialization is failed");
     return -1;
index e6092fc..e7a936d 100644 (file)
@@ -33,8 +33,8 @@ void CPUBoostController::DoBoost(pid_t pid, Level level, int timeout_msec) {
   };
 
   int ret = resource_set_cpu_boosting(res_pid,
-      static_cast<cpu_boosting_level_e>(level), CPU_BOOSTING_RESET_ON_FORK,
-      timeout_msec);
+      static_cast<cpu_boosting_level_e>(level),
+      static_cast<cpu_boosting_flag_e>(0), timeout_msec);
   if (ret != 0)
     _E("resource_set_cpu_boosting() is failed. error: %d", ret);
   else