cpufreq: interactive: Report CPU loads through govinfo notifier
Report CPU load to modules subscribed to cpufreq govinfo notification chain every time governor timer expires to evaluate load. Change-Id: I0b35947b1924c179649aafa0b7b93d974164af1a [junjiew@codeaurora.org: Resolved trivial merge conflicts] Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
This commit is contained in:
parent
2d91526439
commit
f4d69aec4f
1 changed files with 9 additions and 1 deletions
|
@ -421,6 +421,7 @@ static void cpufreq_interactive_timer(unsigned long data)
|
|||
unsigned int index;
|
||||
unsigned long flags;
|
||||
u64 max_fvtime;
|
||||
struct cpufreq_govinfo int_info;
|
||||
|
||||
if (!down_read_trylock(&pcpu->enable_sem))
|
||||
return;
|
||||
|
@ -459,8 +460,15 @@ static void cpufreq_interactive_timer(unsigned long data)
|
|||
do_div(cputime_speedadj, delta_time);
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&pcpu->target_freq_lock, flags);
|
||||
loadadjfreq = (unsigned int)cputime_speedadj * 100;
|
||||
|
||||
int_info.cpu = data;
|
||||
int_info.load = loadadjfreq / pcpu->policy->max;
|
||||
int_info.sampling_rate_us = tunables->timer_rate;
|
||||
atomic_notifier_call_chain(&cpufreq_govinfo_notifier_list,
|
||||
CPUFREQ_LOAD_CHANGE, &int_info);
|
||||
|
||||
spin_lock_irqsave(&pcpu->target_freq_lock, flags);
|
||||
cpu_load = loadadjfreq / pcpu->policy->cur;
|
||||
tunables->boosted = tunables->boost_val || now < tunables->boostpulse_endtime;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue