[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180709152825.GA17598@e108498-lin.cambridge.arm.com>
Date: Mon, 9 Jul 2018 16:28:26 +0100
From: Quentin Perret <quentin.perret@....com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: rjw@...ysocki.net, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org, gregkh@...uxfoundation.org,
mingo@...hat.com, dietmar.eggemann@....com,
morten.rasmussen@....com, chris.redpath@....com,
patrick.bellasi@....com, valentin.schneider@....com,
vincent.guittot@...aro.org, thara.gopinath@...aro.org,
viresh.kumar@...aro.org, tkjos@...gle.com, joel@...lfernandes.org,
smuckle@...gle.com, adharmap@...cinc.com, skannan@...cinc.com,
pkondeti@...eaurora.org, juri.lelli@...hat.com,
edubezval@...il.com, srinivas.pandruvada@...ux.intel.com,
currojerez@...eup.net, javi.merino@...nel.org
Subject: Re: [RFC PATCH v4 09/12] sched/fair: Introduce an energy estimation
helper function
On Monday 09 Jul 2018 at 14:01:38 (+0200), Peter Zijlstra wrote:
> On Fri, Jul 06, 2018 at 06:04:44PM +0100, Quentin Perret wrote:
> > 'max_util' is basically the util we use to request an OPP. 'sum_util' is
> > how long the CPUs will be running.
>
> A indeed. But yes bit of a mess, but it wants doing I think.
OK, understood.
> Perhaps a little something like the below... The alternative is two
> separate but closely related functions, not sure which is better.
>
>
> enum schedutil_type {
> frequency_util,
> energy_util,
> };
Hmm, this should work ... Should we also try to avoid the code
duplication in scale_rt_capacity() ? This doesn't want dependencies on
schedutil I assume so a little bit of extra work is required.
What about moving schedutil_freq_util() to sched.h and give it a more
generic name (total_cpu_util() ?) with no dependencies on
CONFIG_CPU_FREQ_GOV_SCHEDUTIL ? Also, 'energy_util' would have to be
renamed I guess (busy_time_util ?).
Then scale_rt_capacity() can be turned into something like (totally
untested):
static unsigned long scale_rt_capacity(int cpu)
{
unsigned long util = total_cpu_util(cpu, 0, busy_time_util);
return arch_scale_cpu_capacity(NULL, cpu) - util;
}
Thoughts ?
Thanks,
Quentin
Powered by blists - more mailing lists