Change CPU_BOOSTING_FORCE_RESET_ON_CLEAR to CPU_BOOSTING_FORCE_RESET_ON_SET 19/325319/1 accepted/tizen_9.0_unified tizen_9.0 accepted/tizen/9.0/unified/20250611.103241
authorUnsung Lee <unsung.lee@samsung.com>
Wed, 4 Jun 2025 04:26:54 +0000 (13:26 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Mon, 9 Jun 2025 01:36:47 +0000 (10:36 +0900)
Change CPU_BOOSTING_FORCE_RESET_ON_CLEAR to CPU_BOOSTING_FORCE_RESET_ON_SET
to reset CPU boosting on set instead of clear.

Change-Id: I2a01d8b821c255b0ca9ac3c4f268d0380f893093
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
include/cpu-boosting-type.h
include/cpu-boosting.h
tests/main.c

index 2035b0ceffccc17e9921a4665bad8b6cfe5c1954..2d7afe51f9af820cb9dad78fd8d3c8275892c7e0 100644 (file)
@@ -50,7 +50,7 @@ typedef enum {
  */
 typedef enum resource_cpu_boosting_flag {
        CPU_BOOSTING_RESET_ON_FORK = 0x01,              /**< CPU RESET ON FORK */
-       CPU_BOOSTING_FORCE_RESET_ON_CLEAR = 0x02,       /**< CPU FORCE RESET ON CLEAR */
+       CPU_BOOSTING_FORCE_RESET_ON_SET = 0x02,         /**< CPU FORCE RESET ON SET */
 } cpu_boosting_flag_e;
 
 /**
index 1c80dc14c1bf35fdf2f2797755ca7e5137b50c00..333f3b95d8f90b21bb8a27f8534dcc0b9f50f166 100644 (file)
@@ -50,8 +50,8 @@ extern "C" {
  * @param[in] flags The cpu boosting flag bits
  *                 If #CPU_BOOSTING_RESET_ON_FORK is set, child processes or threads created by fork() or pthread_create()
  *                 do not inherit boosted CPU schedulder and priority from the parent.
- *                 If #CPU_BOOSTING_FORCE_RESET_ON_CLEAR is set,
- *                 reset CPU boosting forcely on resource_clear_cpu_boosting() regardless of duplicate CPU boosting sets.
+ *                 If #CPU_BOOSTING_FORCE_RESET_ON_SET is set,
+ *                 reset CPU boosting forcely on resource_set_cpu_boosting() regardless of duplicate CPU boosting sets.
  * @param[in] timeout_msec The timeout in milliseconds, -1 to apply boosting permanently
  *
  * @return 0 on success, otherwise a negative error value.
index 5c549a67b0e1581052fde574d76d9aa41a5465f7..a076332f0c0735083ba442048402d58b99ec99fb 100644 (file)
@@ -261,10 +261,9 @@ static int test_multi_process_one_thread_force_reset(int pid_count, cpu_boosting
 
        /**
         * Parent process forcely resets CPU boosting level as CPU_BOOSTING_LEVEL_NONE,
-        * when CPU_BOOSTING_FORCE_RESET_ON_CLEAR is set.
+        * when CPU_BOOSTING_FORCE_RESET_ON_SET is set.
         */
        test_set_cpu_boosting(resource_pid, CPU_BOOSTING_LEVEL_NONE, flags, -1);
-       test_clear_cpu_boosting(resource_pid);
        ret = resource_get_cpu_boosting_level(resource_pid, &level);
        if (ret < 0) {
                _E("Failed to get cpu boosting level: ret (%d)", ret);
@@ -368,9 +367,9 @@ int main (void)
        /* Case 2: Boosting single-threaded processes */
        _D("[CPU-BOOSTING-TEST] <<<<<<<<<< Multi Processes One Thread >>>>>>>>>>");
        multi_process_one_thread_test(7);
-       ret = test_multi_process_one_thread_force_reset(7, CPU_BOOSTING_FORCE_RESET_ON_CLEAR);
+       ret = test_multi_process_one_thread_force_reset(7, CPU_BOOSTING_FORCE_RESET_ON_SET);
        if (ret < 0) {
-               _E("Failed to test multi process with CPU_BOOSTING_FORCE_RESET_ON_CLEAR: ret (%d)", ret);
+               _E("Failed to test multi process with CPU_BOOSTING_FORCE_RESET_ON_SET: ret (%d)", ret);
                return 1;
        }