summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangYoun Kwak <sy.kwak@samsung.com>2024-08-08 13:17:58 +0900
committerSangYoun Kwak <sy.kwak@samsung.com>2024-08-08 13:18:39 +0900
commit38cd18d8ad9eb0105a7d80f184e7e785453cda71 (patch)
tree9490286c3ff6afce951d67b973ad58f358b751e3
parent8ffd276da7741fd124d4571cfa899cb6bd2cbe08 (diff)
downloadresourced-38cd18d8ad9eb0105a7d80f184e7e785453cda71.tar.gz
resourced-38cd18d8ad9eb0105a7d80f184e7e785453cda71.tar.bz2
resourced-38cd18d8ad9eb0105a7d80f184e7e785453cda71.zip
process: Remove unnecessary comments and indentations
Change-Id: I27827bb5f0ace7b46a44cb437854c07f801e13ec Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
-rw-r--r--src/process/proc-main.c113
1 files changed, 30 insertions, 83 deletions
diff --git a/src/process/proc-main.c b/src/process/proc-main.c
index b29084eb..20de2665 100644
--- a/src/process/proc-main.c
+++ b/src/process/proc-main.c
@@ -981,80 +981,42 @@ __attribute__((weak)) struct proc_app_info *proc_create_app_info(const char *app
}
switch (pci->cpu_sched_info.cpu_sched_type) {
- case CPU_SCHED_NONE:
- if (attr.sched_nice == CPU_INIT_NICE)
- goto skip_scheduler_update;
- attr.sched_policy = SCHED_OTHER;
- break;
- case CPU_SCHED_OTHER:
- attr.sched_policy = SCHED_OTHER;
-/* error = sched_getattr(pid, &attr, 0);
- if (error)
- _E("[PROCESS] Failed to get sched attributes");
-
- if (attr.sched_policy != SCHED_OTHER)
- _E("[PROCESS] current policy (%d) is different from %d",
- attr.sched_policy, SCHED_OTHER);*/
- break;
- case CPU_SCHED_IDLE:
- attr.sched_policy = SCHED_IDLE;
-/* error = sched_getattr(pid, &attr, 0);
- if (error)
- _E("[PROCESS] Failed to get sched attributes");
-
- if (attr.sched_policy != SCHED_IDLE)
- _E("[PROCESS] current policy (%d) is different from %d",
- attr.sched_policy, SCHED_IDLE);*/
- break;
- case CPU_SCHED_BATCH:
- attr.sched_policy = SCHED_BATCH;
-/* error = sched_getattr(pid, &attr, 0);
- if (error)
- _E("[PROCESS] Failed to get sched attributes");
-
- if (attr.sched_policy != SCHED_BATCH)
- _E("[PROCESS] current policy (%d) is different from %d",
- attr.sched_policy, SCHED_BATCH);*/
- break;
- case CPU_SCHED_FIFO:
- attr.sched_policy = SCHED_FIFO;
-/* error = sched_getattr(pid, &attr, 0);
- if (error)
- _E("[PROCESS] Failed to get sched attributes");
-
- if (attr.sched_policy != SCHED_FIFO)
- _E("[PROCESS] current policy (%d) is different from %d",
- attr.sched_policy, SCHED_FIFO);*/
- break;
- case CPU_SCHED_RR:
- attr.sched_policy = SCHED_RR;
-/* error = sched_getattr(pid, &attr, 0);
- if (error)
- _E("[PROCESS] Failed to get sched attributes");
-
- if (attr.sched_policy != SCHED_RR)
- _E("[PROCESS] current policy (%d) is different from %d",
- attr.sched_policy, SCHED_RR);*/
- break;
- case CPU_SCHED_DEADLINE:
- attr.sched_policy = SCHED_DEADLINE;
-/* error = sched_getattr(pid, &attr, 0);
- if (error)
- _E("[PROCESS] Failed to get sched attributes");*/
- break;
- default:
- _E("[PROCESS] Unknown CPU sched type");
+ case CPU_SCHED_NONE:
+ if (attr.sched_nice == CPU_INIT_NICE)
+ goto skip_scheduler_update;
+ attr.sched_policy = SCHED_OTHER;
+ break;
+ case CPU_SCHED_OTHER:
+ attr.sched_policy = SCHED_OTHER;
+ break;
+ case CPU_SCHED_IDLE:
+ attr.sched_policy = SCHED_IDLE;
+ break;
+ case CPU_SCHED_BATCH:
+ attr.sched_policy = SCHED_BATCH;
+ break;
+ case CPU_SCHED_FIFO:
+ attr.sched_policy = SCHED_FIFO;
+ break;
+ case CPU_SCHED_RR:
+ attr.sched_policy = SCHED_RR;
+ break;
+ case CPU_SCHED_DEADLINE:
+ attr.sched_policy = SCHED_DEADLINE;
+ break;
+ default:
+ _E("[PROCESS] Unknown CPU sched type");
}
error = sched_setattr_of_all_tasks(pid, &attr, 0);
if (error)
_E("[PROCESS] Failed to set sched attributes");
_I("[PROCESS] policy = %s", attr.sched_policy == SCHED_IDLE ? "SCHED_IDLE" :
- attr.sched_policy == SCHED_BATCH ? "SCHED_BATCH" :
- attr.sched_policy == SCHED_OTHER ? "SCHED_OTHER" :
- attr.sched_policy == SCHED_FIFO ? "SCHED_FIFO" :
- attr.sched_policy == SCHED_RR ? "SCHED_RR" :
- attr.sched_policy == SCHED_DEADLINE ? "SCHED_DEADLINE" : "UNKNOWN");
+ attr.sched_policy == SCHED_BATCH ? "SCHED_BATCH" :
+ attr.sched_policy == SCHED_OTHER ? "SCHED_OTHER" :
+ attr.sched_policy == SCHED_FIFO ? "SCHED_FIFO" :
+ attr.sched_policy == SCHED_RR ? "SCHED_RR" :
+ attr.sched_policy == SCHED_DEADLINE ? "SCHED_DEADLINE" : "UNKNOWN");
_I("[PROCESS] nice = %d", attr.sched_nice);
_I("[PROCESS] priority = %d", attr.sched_priority);
@@ -1062,21 +1024,6 @@ skip_scheduler_update:
if (pci->watchdog_action == PROC_ACTION_IGNORE)
pai->app_watchdog_exclude = true;
- /* register RT throttling */
-/* if (pci->cpu_sched_info.cpu_sched_type == CPU_SCHED_FIFO ||
- pci->cpu_sched_info.cpu_sched_type == CPU_SCHED_RR ||
- pci->cpu_sched_info.cpu_sched_type == CPU_SCHED_DEADLINE) {
- if (pci->cpu_sched_info.rt_period_us > 0 &&
- pci->cpu_sched_info.rt_runtime_us > 0 &&
- pci->cpu_sched_info.rt_period_us > pci->cpu_sched_info.rt_runtime_us) {
- struct proc_status ps = {0, };
-
- ps.pid = pid;
- ps.pci = pci;
- resourced_notify(RESOURCED_NOTIFIER_RT_SCHEDULER, &ps);
- }
- }*/
-
if (pci->mem_action.memory_bytes && pci->mem_action.action) {
struct proc_limit_status pls = {0, };