lkml.org 
[lkml]   [2018]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v3 07/10] sched/fair: Introduce an energy estimation helper function
On 21/05/18 15:25, Quentin Perret wrote:

[...]

> +static long compute_energy(struct task_struct *p, int dst_cpu)
> +{
> + long util, max_util, sum_util, energy = 0;
> + struct sched_energy_fd *sfd;
> + int cpu;
> +
> + for_each_freq_domain(sfd) {
> + max_util = sum_util = 0;
> + for_each_cpu_and(cpu, freq_domain_span(sfd), cpu_online_mask) {
> + util = cpu_util_next(cpu, p, dst_cpu);
> + util += cpu_util_dl(cpu_rq(cpu));
> + /* XXX: add RT util_avg when available. */

em_fd_energy() below uses this to know which power to pick in the freq
table. So, if you have any RT task running on cpu freq will be at max
anyway. It seems to me that in this case max_util for the freq_domain
must be max_freq (w/o considering rt.util_avg as schedutil does). Then
you could probably still use rt.util_avg to get the percentage of busy
time with sum_util?

> +
> + max_util = max(util, max_util);
> + sum_util += util;
> + }
> +
> + energy += em_fd_energy(sfd->fd, max_util, sum_util);
> + }
> +
> + return energy;
> +}

Best,

- Juri

\
 
 \ /
  Last update: 2018-06-08 12:32    [W:0.537 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site