From: Chanwoo Choi Date: Wed, 4 May 2016 11:45:49 +0000 (+0900) Subject: pass: gov: Fix the bug of radiation governor X-Git-Tag: submit/tizen/20170328.004502~97 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5f8544e88a182abf03e9e1d8c382280ceac71476;p=platform%2Fcore%2Fsystem%2Fpass.git pass: gov: Fix the bug of radiation governor This patch fixes the bug of radiation governor Change-Id: Iba76f9646149871770a81f8aff39e39b6f673c47 Signed-off-by: Chanwoo Choi --- diff --git a/src/pass/pass-gov-radiation.c b/src/pass/pass-gov-radiation.c index 98b634f..c403959 100644 --- a/src/pass/pass-gov-radiation.c +++ b/src/pass/pass-gov-radiation.c @@ -168,15 +168,23 @@ int pass_radiation_governor(struct pass_policy *policy) } } - if (up_count * 100 >= num_pass_gov * up_threshold) + if (up_count * 100 >= num_pass_gov * up_threshold) { level += policy->cpufreq.num_nr_cpus; - else if (down_count * 100 >= num_pass_gov * down_threshold) + + if (level > policy->max_level) + level -= policy->cpufreq.num_nr_cpus; + } else if (down_count * 100 >= num_pass_gov * down_threshold) { level -= policy->cpufreq.num_nr_cpus; + } - if (right_count * 100 >= num_pass_gov * up_threshold) + if (right_count * 100 >= num_pass_gov * up_threshold) { level += 1; - else if (left_count * 100 >= num_pass_gov * down_threshold) + + if (level > policy->max_level) + level -= 1; + } else if (left_count * 100 >= num_pass_gov * down_threshold) { level -= 1; + } /* if (level == policy->prev_level) {