lkml.org 
[lkml]   [2019]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V2 1/3] Calculate Thermal Pressure
On Tuesday 16 Apr 2019 at 15:38:39 (-0400), Thara Gopinath wrote:
> +/**
> + * Function to update thermal pressure from cooling device
> + * or any framework responsible for capping cpu maximum
> + * capacity.
> + */
> +void sched_update_thermal_pressure(struct cpumask *cpus,
> + unsigned long cap_max_freq,
> + unsigned long max_freq)
> +{
> + int cpu;
> + unsigned long flags = 0;
> + struct thermal_pressure *cpu_thermal;
> +
> + for_each_cpu(cpu, cpus) {

Is it actually required to do this for each CPU ? You could calculate
the whole thing once for the first CPU, and apply the result to all CPUs
in the policy no ? All CPUs in a policy are capped and uncapped
synchronously.

> + cpu_thermal = per_cpu(thermal_pressure_cpu, cpu);
> + if (!cpu_thermal)
> + return;
> + spin_lock_irqsave(&cpu_thermal->lock, flags);
> + thermal_pressure_update(cpu_thermal, cap_max_freq, max_freq, 1);
> + }
> +}

\
 
 \ /
  Last update: 2019-04-18 12:15    [W:0.165 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site