diff options
-rw-r--r-- | src/resourced/init.c | 88 |
1 files changed, 25 insertions, 63 deletions
diff --git a/src/resourced/init.c b/src/resourced/init.c index 463c7dfa..c3b3086d 100644 --- a/src/resourced/init.c +++ b/src/resourced/init.c @@ -297,69 +297,31 @@ int fixed_list_init(enum proc_type proc_type) attr.sched_priority = CPU_INIT_PRIO; 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("[CPU-SCHED] Failed to get sched attributes"); - - if (attr.sched_policy != SCHED_OTHER) - _E("[CPU-SCHED] 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("[CPU-SCHED] Failed to get sched attributes"); - - if (attr.sched_policy != SCHED_IDLE) - _E("[CPU-SCHED] 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("[CPU-SCHED] Failed to get sched attributes"); - - if (attr.sched_policy != SCHED_BATCH) - _E("[CPU-SCHED] 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("[CPU-SCHED] Failed to get sched attributes"); - - if (attr.sched_policy != SCHED_FIFO) - _E("[CPU-SCHED] 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("[CPU-SCHED] Failed to get sched attributes"); - - if (attr.sched_policy != SCHED_RR) - _E("[CPU-SCHED] 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("[CPU-SCHED] Failed to get sched attributes");*/ - break; - default: - _E("[CPU-SCHED] 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("[CPU-SCHED] Unknown CPU sched type"); } error = sched_setattr_of_all_tasks(pid, &attr, 0); if (error) |