lkml.org 
[lkml]   [2021]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] sched/fair: Take thermal pressure into account while estimating energy
Hi Lukasz,

On Wednesday 02 Jun 2021 at 14:56:08 (+0100), Lukasz Luba wrote:
> compute_energy(struct task_struct *p, int dst_cpu, struct perf_domain *pd)
> {
> struct cpumask *pd_mask = perf_domain_span(pd);
> - unsigned long cpu_cap = arch_scale_cpu_capacity(cpumask_first(pd_mask));
> + unsigned long _cpu_cap = arch_scale_cpu_capacity(cpumask_first(pd_mask));
> unsigned long max_util = 0, sum_util = 0;
> + unsigned long cpu_cap = _cpu_cap;
> int cpu;
>
> /*
> @@ -6558,6 +6559,14 @@ compute_energy(struct task_struct *p, int dst_cpu, struct perf_domain *pd)
> cpu_util_next(cpu, p, -1) + task_util_est(p);
> }
>
> + /*
> + * Take the thermal pressure from non-idle CPUs. They have
> + * most up-to-date information. For idle CPUs thermal pressure
> + * signal is not updated so often.
> + */
> + if (!idle_cpu(cpu))
> + cpu_cap = _cpu_cap - thermal_load_avg(cpu_rq(cpu));

This messes up the irq time scaling no? Maybe move the capping in this
function instead of relying on effective_cpu_util() to do it for you?

> /*
> * Busy time computation: utilization clamping is not
> * required since the ratio (sum_util / cpu_capacity)
> --
> 2.17.1
>

\
 
 \ /
  Last update: 2021-06-02 17:01    [W:0.055 / U:1.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site