lkml.org 
[lkml]   [2018]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v4 09/12] sched/fair: Introduce an energy estimation helper function
On Thu, Jun 28, 2018 at 12:40:40PM +0100, Quentin Perret wrote:
> +static long
compute_energy(struct task_struct *p, int dst_cpu, struct freq_domain *fd)
> +{
> + long util, max_util, sum_util, energy = 0;
> + int cpu;
> +
> + while (fd) {
> + max_util = sum_util = 0;
> + for_each_cpu_and(cpu, freq_domain_span(fd), cpu_online_mask) {

I had a wee little wtf moment when I realized this crosses root_domain
boundaries but that that is actually desired. A comment might be in
order.

> + util = cpu_util_next(cpu, p, dst_cpu);
> + util += cpu_util_dl(cpu_rq(cpu));
> + /* XXX: add RT util_avg when available. */
> +
> + max_util = max(util, max_util);
> + sum_util += util;

Did you want to use sugov_get_util() here? There is no way we're going
to duplicate all that.

ISTR we already established the whole EAS was going to require using
schedutil anyway.

> + }
> +
> + energy += em_fd_energy(fd->obj, max_util, sum_util);
> + fd = fd->next;
> + }
> +
> + return energy;
> +}

\
 
 \ /
  Last update: 2018-07-06 15:14    [W:1.146 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site