From: Chanwoo Choi Date: Thu, 19 Jan 2017 09:46:29 +0000 (+0900) Subject: pass: gov: Fix bug radiation governor when the number of load entry is zero X-Git-Tag: submit/tizen/20170328.004502~78 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49aa10c4afd43d0777c632b9f642aea31be98eef;p=platform%2Fcore%2Fsystem%2Fpass.git pass: gov: Fix bug radiation governor when the number of load entry is zero The radiation governor uses the history of CPU utilization in order to decide the proper pass level. If CPU idle time is over period time (default 400ms), there is no any history of cpu utilization. If the number of history is zero, the governor have to return with previous pass level. So, this patch handle the error case if the number of load entry is zero. Change-Id: If32d334b21059a5c889c866a0e70f41181133ebd Reported-by: Eunki Hong Signed-off-by: Chanwoo Choi --- diff --git a/src/pass/pass-gov-radiation.c b/src/pass/pass-gov-radiation.c index 27b0b4a..2a72258 100644 --- a/src/pass/pass-gov-radiation.c +++ b/src/pass/pass-gov-radiation.c @@ -168,6 +168,9 @@ int pass_radiation_governor(struct pass_policy *policy) } } + if (!num_pass_gov) + return level; + if (up_count * 100 >= num_pass_gov * up_threshold) { level += policy->cpufreq.num_nr_cpus;