From: Hyotaek Shim Date: Tue, 28 Jun 2022 10:31:56 +0000 (+0900) Subject: Improve explanation in cpu boosting API specification X-Git-Tag: accepted/tizen/unified/20220629.021813^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fb167df48a0c45e01edb06086fafc2177bcb1bc8;p=platform%2Fcore%2Fapi%2Fresource.git Improve explanation in cpu boosting API specification Also delete unnecessary pid field in cpu_boosting_level_info_t Change-Id: I0bcddf62844e86869ab176abbbc1780d315f2342 Signed-off-by: Hyotaek Shim --- diff --git a/include/cpu-boosting-type.h b/include/cpu-boosting-type.h index de74042..be23729 100644 --- a/include/cpu-boosting-type.h +++ b/include/cpu-boosting-type.h @@ -42,7 +42,6 @@ typedef struct resource_pid_info { } resource_pid_t; typedef struct resource_cpu_boosting_level_info { - int pid_level; int *tid_level; int tid_count; } cpu_boosting_level_info_t; diff --git a/include/cpu-boosting.h b/include/cpu-boosting.h index ad6aa37..39f1e8a 100644 --- a/include/cpu-boosting.h +++ b/include/cpu-boosting.h @@ -32,10 +32,12 @@ extern "C" { /** * @brief Set cpu boosting for the target process (pid/tids). * + * @remarks The original cpu schedule configuration of the target process is backed up if it is currently not boosted. \n * @param[in] pid The target process pid/tids \n - * If pid.pid is nonzero, pid.tid and pid.tid_count are ignored. \n + * If pid.pid is nonzero, pid.tid and pid.tid_count are ignored, \n + * and cpu boosting is applied for all the threads of pid.pid. \n * If pid.pid is zero and pid.tid is not NULL, all tids in the list are used \n - * If pid.pid is zero and pid.tid is NULL, pid of the calling thread is used. \n + * If pid.pid is zero and pid.tid is NULL, tid of the calling thread is used. \n * The caller must (de)allocate the buffer in the pid.tid pointer. * @param[in] level The cpu boosting level * @param[in] timeout_msec The timeout in milliseconds, -1 to apply boosting permanently @@ -47,10 +49,13 @@ int resource_set_cpu_boosting (resource_pid_t pid, cpu_boosting_level_e level, i /** * @brief Clear cpu boosting for the target process (pid/tids). * + * @remarks The backed-up cpu schedule configuration of the target process is restored. \n + * Without the backed-up configuration, the default non-boosting configuration (SCHED_OTHER and nice=0) is applied. \n * @param[in] pid The target process pid/tids \n - * If pid.pid is nonzero, pid.tid and pid.tid_count are ignored. \n + * If pid.pid is nonzero, pid.tid and pid.tid_count are ignored, \n + * and cpu boosting is cleared for all the threads of pid.pid. \n * If pid.pid is zero and pid.tid is not NULL, all tids in the list are used \n - * If pid.pid is zero and pid.tid is NULL, pid of the calling thread is used. \n + * If pid.pid is zero and pid.tid is NULL, tid of the calling thread is used. \n * The caller must (de)allocate the buffer in the pid.tid pointer. * * @return 0 on success, otherwise a negative error value. @@ -61,12 +66,13 @@ int resource_clear_cpu_boosting (resource_pid_t pid); * @brief Get the cpu boosting level for the target process (pid/tids). * * @param[in] pid The target process pid/tids \n - * If pid.pid is nonzero, pid.tid and pid.tid_count are ignored. \n - * If pid.pid is zero and pid.tid is not NULL, all tids in the list are used \n - * If pid.pid is zero and pid.tid is NULL, pid of the calling thread is used. \n + * If pid.pid is nonzero, pid.tid and pid.tid_count are ignored, \n + * and all the threads of pid.pid are checked. \n + * If pid.pid is zero and pid.tid is not NULL, all tids in the list are checked. \n + * If pid.pid is zero and pid.tid is NULL, the calling thread is checked. \n * The caller must (de)allocate the buffer in the pid.tid pointer. * @param[out] level The boosting level for the target process (pid/tids) \n - * The level argument will be filled with the level value corresponding to the pid argument. \n + * The level->tid_level array will be filled with cpu_boosting_level_e for tids requested by the pid argument. \n * The caller must (de)allocate the buffer in the level.tid_level pointer. * * @return 0 on success, otherwise a negative error value. @@ -100,6 +106,7 @@ int resource_clear_cpu_inheritance (int source_tid, const char *dest_process); * @param[in] dest_process The name of destination process * @param[in] pid The destination process pid/tids \n * If pid.pid is nonzero, pid.tid and pid.tid_count are ignored. \n + * and all the threads of pid.pid are registered. \n * If pid.pid is zero and pid.tid is not NULL, all tids in the list are used \n * If pid.pid is zero and pid.tid is NULL, pid of the calling thread is used. \n * The caller must (de)allocate the buffer in the pid.tid pointer.