[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YLedIMNFlZ5eu2Oe@google.com>
Date: Wed, 2 Jun 2021 15:00:48 +0000
From: Quentin Perret <qperret@...gle.com>
To: Lukasz Luba <lukasz.luba@....com>
Cc: linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
peterz@...radead.org, rjw@...ysocki.net, viresh.kumar@...aro.org,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
vincent.donnefort@....com, mingo@...hat.com, juri.lelli@...hat.com,
rostedt@...dmis.org, segall@...gle.com, mgorman@...e.de,
bristot@...hat.com
Subject: Re: [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
>
Powered by blists - more mailing lists