Improve explanation in cpu boosting API specification 60/276960/8 accepted/tizen/unified/20220629.021813 submit/tizen/20220628.084224
authorHyotaek Shim <hyotaek.shim@samsung.com>
Tue, 28 Jun 2022 10:31:56 +0000 (19:31 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Tue, 28 Jun 2022 11:00:06 +0000 (20:00 +0900)
Also delete unnecessary pid field in cpu_boosting_level_info_t

Change-Id: I0bcddf62844e86869ab176abbbc1780d315f2342
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
include/cpu-boosting-type.h
include/cpu-boosting.h

index de74042..be23729 100644 (file)
@@ -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;
index ad6aa37..39f1e8a 100644 (file)
@@ -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.