Loading drivers/cpufreq/cpufreq_interactive.c +15 −44 Original line number Diff line number Diff line Loading @@ -56,8 +56,6 @@ struct cpufreq_interactive_cpuinfo { bool limits_changed; }; #define MIN_TIMER_JIFFIES 1UL static DEFINE_PER_CPU(struct cpufreq_interactive_cpuinfo, cpuinfo); /* realtime thread handles frequency scaling */ Loading Loading @@ -173,16 +171,12 @@ static void cpufreq_interactive_timer_resched( * function. */ static void cpufreq_interactive_timer_start( struct cpufreq_interactive_tunables *tunables, int cpu, int time_override) struct cpufreq_interactive_tunables *tunables, int cpu) { struct cpufreq_interactive_cpuinfo *pcpu = &per_cpu(cpuinfo, cpu); unsigned long expires = jiffies + usecs_to_jiffies(tunables->timer_rate); unsigned long flags; unsigned long expires; if (time_override) expires = jiffies + time_override; else expires = jiffies + usecs_to_jiffies(tunables->timer_rate); pcpu->cpu_timer.expires = expires; add_timer_on(&pcpu->cpu_timer, cpu); Loading Loading @@ -1279,7 +1273,6 @@ static int cpufreq_governor_interactive(struct cpufreq_policy *policy, unsigned int j; struct cpufreq_interactive_cpuinfo *pcpu; struct cpufreq_frequency_table *freq_table; unsigned long expire_time; struct cpufreq_interactive_tunables *tunables; if (have_governor_per_policy()) Loading Loading @@ -1372,7 +1365,7 @@ static int cpufreq_governor_interactive(struct cpufreq_policy *policy, down_write(&pcpu->enable_sem); del_timer_sync(&pcpu->cpu_timer); del_timer_sync(&pcpu->cpu_slack_timer); cpufreq_interactive_timer_start(tunables, j, 0); cpufreq_interactive_timer_start(tunables, j); pcpu->governor_enabled = 1; up_write(&pcpu->enable_sem); } Loading Loading @@ -1415,43 +1408,21 @@ static int cpufreq_governor_interactive(struct cpufreq_policy *policy, /* update target_freq firstly */ if (policy->max < pcpu->target_freq) pcpu->target_freq = policy->max; /* * Delete and reschedule timer. * Else the timer callback may return without * re-arming the timer when it fails to acquire * the semaphore. This race condition may cause the * timer to stop unexpectedly. else if (policy->min > pcpu->target_freq) pcpu->target_freq = policy->min; /* Reschedule timer. * Delete the timers, else the timer callback may * return without re-arm the timer when failed * acquire the semaphore. This race may cause timer * stopped unexpectedly. */ del_timer_sync(&pcpu->cpu_timer); del_timer_sync(&pcpu->cpu_slack_timer); if (policy->min >= pcpu->target_freq) { pcpu->target_freq = policy->min; /* * Reschedule timer. * The governor needs more time to evaluate * the load after changing policy parameters. */ cpufreq_interactive_timer_start(tunables, j, 0); } else { /* * Reschedule timer with variable duration. * No boost was applied so the governor * doesn't need extra time to evaluate load. * The timer can be set to fire quicker if it * was already going to expire soon. */ expire_time = pcpu->cpu_timer.expires - jiffies; expire_time = min( usecs_to_jiffies(tunables->timer_rate), expire_time); expire_time = max(MIN_TIMER_JIFFIES, expire_time); cpufreq_interactive_timer_start(tunables, j); up_write(&pcpu->enable_sem); cpufreq_interactive_timer_start(tunables, j, expire_time); } pcpu->limits_changed = true; up_write(&pcpu->enable_sem); } break; } Loading Loading
drivers/cpufreq/cpufreq_interactive.c +15 −44 Original line number Diff line number Diff line Loading @@ -56,8 +56,6 @@ struct cpufreq_interactive_cpuinfo { bool limits_changed; }; #define MIN_TIMER_JIFFIES 1UL static DEFINE_PER_CPU(struct cpufreq_interactive_cpuinfo, cpuinfo); /* realtime thread handles frequency scaling */ Loading Loading @@ -173,16 +171,12 @@ static void cpufreq_interactive_timer_resched( * function. */ static void cpufreq_interactive_timer_start( struct cpufreq_interactive_tunables *tunables, int cpu, int time_override) struct cpufreq_interactive_tunables *tunables, int cpu) { struct cpufreq_interactive_cpuinfo *pcpu = &per_cpu(cpuinfo, cpu); unsigned long expires = jiffies + usecs_to_jiffies(tunables->timer_rate); unsigned long flags; unsigned long expires; if (time_override) expires = jiffies + time_override; else expires = jiffies + usecs_to_jiffies(tunables->timer_rate); pcpu->cpu_timer.expires = expires; add_timer_on(&pcpu->cpu_timer, cpu); Loading Loading @@ -1279,7 +1273,6 @@ static int cpufreq_governor_interactive(struct cpufreq_policy *policy, unsigned int j; struct cpufreq_interactive_cpuinfo *pcpu; struct cpufreq_frequency_table *freq_table; unsigned long expire_time; struct cpufreq_interactive_tunables *tunables; if (have_governor_per_policy()) Loading Loading @@ -1372,7 +1365,7 @@ static int cpufreq_governor_interactive(struct cpufreq_policy *policy, down_write(&pcpu->enable_sem); del_timer_sync(&pcpu->cpu_timer); del_timer_sync(&pcpu->cpu_slack_timer); cpufreq_interactive_timer_start(tunables, j, 0); cpufreq_interactive_timer_start(tunables, j); pcpu->governor_enabled = 1; up_write(&pcpu->enable_sem); } Loading Loading @@ -1415,43 +1408,21 @@ static int cpufreq_governor_interactive(struct cpufreq_policy *policy, /* update target_freq firstly */ if (policy->max < pcpu->target_freq) pcpu->target_freq = policy->max; /* * Delete and reschedule timer. * Else the timer callback may return without * re-arming the timer when it fails to acquire * the semaphore. This race condition may cause the * timer to stop unexpectedly. else if (policy->min > pcpu->target_freq) pcpu->target_freq = policy->min; /* Reschedule timer. * Delete the timers, else the timer callback may * return without re-arm the timer when failed * acquire the semaphore. This race may cause timer * stopped unexpectedly. */ del_timer_sync(&pcpu->cpu_timer); del_timer_sync(&pcpu->cpu_slack_timer); if (policy->min >= pcpu->target_freq) { pcpu->target_freq = policy->min; /* * Reschedule timer. * The governor needs more time to evaluate * the load after changing policy parameters. */ cpufreq_interactive_timer_start(tunables, j, 0); } else { /* * Reschedule timer with variable duration. * No boost was applied so the governor * doesn't need extra time to evaluate load. * The timer can be set to fire quicker if it * was already going to expire soon. */ expire_time = pcpu->cpu_timer.expires - jiffies; expire_time = min( usecs_to_jiffies(tunables->timer_rate), expire_time); expire_time = max(MIN_TIMER_JIFFIES, expire_time); cpufreq_interactive_timer_start(tunables, j); up_write(&pcpu->enable_sem); cpufreq_interactive_timer_start(tunables, j, expire_time); } pcpu->limits_changed = true; up_write(&pcpu->enable_sem); } break; } Loading