[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180410125105.GC4043@hirez.programming.kicks-ass.net>
Date: Tue, 10 Apr 2018 14:51:05 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Dietmar Eggemann <dietmar.eggemann@....com>
Cc: linux-kernel@...r.kernel.org,
Quentin Perret <quentin.perret@....com>,
Thara Gopinath <thara.gopinath@...aro.org>,
linux-pm@...r.kernel.org,
Morten Rasmussen <morten.rasmussen@....com>,
Chris Redpath <chris.redpath@....com>,
Patrick Bellasi <patrick.bellasi@....com>,
Valentin Schneider <valentin.schneider@....com>,
"Rafael J . Wysocki" <rjw@...ysocki.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
Viresh Kumar <viresh.kumar@...aro.org>,
Todd Kjos <tkjos@...gle.com>,
Joel Fernandes <joelaf@...gle.com>,
Juri Lelli <juri.lelli@...hat.com>,
Steve Muckle <smuckle@...gle.com>,
Eduardo Valentin <edubezval@...il.com>
Subject: Re: [RFC PATCH v2 4/6] sched/fair: Introduce an energy estimation
helper function
On Fri, Apr 06, 2018 at 04:36:05PM +0100, Dietmar Eggemann wrote:
> +static inline
> +struct capacity_state *find_cap_state(int cpu, unsigned long util)
> +{
> + struct sched_energy_model *em = *per_cpu_ptr(energy_model, cpu);
> + struct capacity_state *cs = NULL;
> + int i;
> +
> + util += util >> 2;
> +
> + for (i = 0; i < em->nr_cap_states; i++) {
> + cs = &em->cap_states[i];
> + if (cs->cap >= util)
> + break;
> + }
> +
> + return cs;
> +}
So in the last thread there was some discussion about this; in
particular on how this related to schedutil and if we should tie it into
that.
I think for starters tying it to schedutil is not a bad idea; ideally
people _should_ migrate towards using that.
Also; I think it makes sense to better integrate cpufreq and the
energy-model values like what rjw already suggested, such that maybe we
can have cpufreq_driver_resolve_freq() return a structure containing the
relevant information for the selected frequency.
But implementing the frequency selection thing in multiple places like
now sounds like a very bad idea to me.
Powered by blists - more mailing lists