Skip to content
This repository has been archived by the owner on Jan 7, 2018. It is now read-only.

Commit

Permalink
alucard cpu gov: reset rate protection using target_freq_lock spinlock.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alucard24 authored and AndroPlus-org committed Dec 2, 2016
1 parent 3444838 commit 199121b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/cpufreq/cpufreq_alucard.c
Expand Up @@ -326,11 +326,6 @@ static void cpufreq_alucard_timer(unsigned long data)
cpus_up_rate = tunables->cpus_up_rate_at_max_freq;
cpus_down_rate = tunables->cpus_down_rate_at_max_freq;
}
if (ppol->up_rate > cpus_up_rate)
ppol->up_rate = 1;
if (ppol->down_rate > cpus_down_rate)
ppol->down_rate = 1;


max_cpu = cpumask_first(ppol->policy->cpus);
for_each_cpu(i, ppol->policy->cpus) {
Expand Down Expand Up @@ -363,6 +358,11 @@ static void cpufreq_alucard_timer(unsigned long data)

/* Check for frequency increase or for frequency decrease */
spin_lock_irqsave(&ppol->target_freq_lock, flags);
if (ppol->up_rate > cpus_up_rate)
ppol->up_rate = 1;
if (ppol->down_rate > cpus_down_rate)
ppol->down_rate = 1;

if (max_load >= target_cpu_load
&& ppol->policy->cur < ppol->policy->max) {
if (ppol->up_rate % cpus_up_rate == 0) {
Expand Down

0 comments on commit 199121b

Please sign in to comment.