[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180619095340.GS17720@e108498-lin.cambridge.arm.com>
Date: Tue, 19 Jun 2018 10:53:40 +0100
From: Quentin Perret <quentin.perret@....com>
To: Pavan Kondeti <pkondeti@...eaurora.org>
Cc: peterz@...radead.org, rjw@...ysocki.net,
gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.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, joelaf@...gle.com, smuckle@...gle.com,
adharmap@...cinc.com, skannan@...cinc.com, juri.lelli@...hat.com,
edubezval@...il.com, srinivas.pandruvada@...ux.intel.com,
currojerez@...eup.net, javi.merino@...nel.org
Subject: Re: [RFC PATCH v3 07/10] sched/fair: Introduce an energy estimation
helper function
On Tuesday 19 Jun 2018 at 15:21:40 (+0530), Pavan Kondeti wrote:
> On Mon, May 21, 2018 at 03:25:02PM +0100, Quentin Perret wrote:
>
> <snip>
>
> >
> > +/*
> > + * Returns the util of "cpu" if "p" wakes up on "dst_cpu".
> > + */
> > +static unsigned long cpu_util_next(int cpu, struct task_struct *p, int dst_cpu)
> > +{
> > + unsigned long util, util_est;
> > + struct cfs_rq *cfs_rq;
> > +
> > + /* Task is where it should be, or has no impact on cpu */
> > + if ((task_cpu(p) == dst_cpu) || (cpu != task_cpu(p) && cpu != dst_cpu))
> > + return cpu_util(cpu);
> > +
> > + cfs_rq = &cpu_rq(cpu)->cfs;
> > + util = READ_ONCE(cfs_rq->avg.util_avg);
> > +
> > + if (dst_cpu == cpu)
> > + util += task_util(p);
> > + else
> > + util = max_t(long, util - task_util(p), 0);
> > +
> > + if (sched_feat(UTIL_EST)) {
> > + util_est = READ_ONCE(cfs_rq->avg.util_est.enqueued);
> > + if (dst_cpu == cpu)
> > + util_est += _task_util_est(p);
> > + else
> > + util_est = max_t(long, util_est - _task_util_est(p), 0);
>
> For UTIL_EST case, the waking task will not have any contribution in the
> previous CPU's util_est. So we can just use the previous CPU util_est as is.
Right, good catch, I actually spotted that one as well and already fixed it
for v4 ;-)
Powered by blists - more mailing lists