[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230513093234.GB4253@hirez.programming.kicks-ass.net>
Date: Sat, 13 May 2023 11:32:34 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Dietmar Eggemann <dietmar.eggemann@....com>
Cc: Ingo Molnar <mingo@...nel.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
Qais Yousef <qyousef@...alina.io>,
Kajetan Puchalski <kajetan.puchalski@....com>,
Morten Rasmussen <morten.rasmussen@....com>,
Vincent Donnefort <vdonnefort@...gle.com>,
Quentin Perret <qperret@...gle.com>,
Abhijeet Dharmapurikar <adharmap@...cinc.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] sched/fair, cpufreq: Introduce 'runnable boosting'
On Fri, May 12, 2023 at 04:39:51PM +0200, Dietmar Eggemann wrote:
> On 12/05/2023 13:22, Peter Zijlstra wrote:
> > On Fri, May 12, 2023 at 12:10:29PM +0200, Dietmar Eggemann wrote:
> >
> >> -static unsigned long cpu_util(int cpu, struct task_struct *p, int dst_cpu)
> >> +static unsigned long
> >> +cpu_util(int cpu, struct task_struct *p, int dst_cpu, int boost)
> >> {
> >> struct cfs_rq *cfs_rq = &cpu_rq(cpu)->cfs;
> >> unsigned long util = READ_ONCE(cfs_rq->avg.util_avg);
> >> + unsigned long runnable;
> >> +
> >> + runnable = boost ? READ_ONCE(cfs_rq->avg.runnable_avg) : 0;
> >> + util = max(util, runnable);
> >>
> > if (boost)
> > util = max(util, READ_ONCE(cfs_rq->avg.runnable_avg));
>
> I need the util_est = max(util_est, runnable) further down as well. Just
> want to fetch runnable only once.
Ah, fair enought; but still, please use a regular if().
Powered by blists - more mailing lists