[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241011085201.GM17263@noisy.programming.kicks-ass.net>
Date: Fri, 11 Oct 2024 10:52:01 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Xavier <xavier_qy@....com>
Cc: mingo@...hat.com, juri.lelli@...hat.com, vincent.guittot@...aro.org,
dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
mgorman@...e.de, vschneid@...hat.com, yu.c.chen@...el.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] sched/eevdf: Reduce the computation frequency of
avg_vruntime
On Fri, Oct 11, 2024 at 02:24:49PM +0800, Xavier wrote:
> The current code subtracts the value of curr from avg_vruntime and avg_load
> during runtime. Then, every time avg_vruntime() is called, it adds the
> value of curr to the avg_vruntime and avg_load. Afterward, it divides these
> and adds min_vruntime to obtain the actual avg_vruntime.
>
> Analysis of the code indicates that avg_vruntime only changes significantly
> during update_curr(), update_min_vruntime(), and when tasks are enqueued or
> dequeued. Therefore, it is sufficient to recalculate and store avg_vruntime
> only in these specific scenarios. This optimization ensures that accessing
> avg_vruntime() does not necessitate a recalculation each time, thereby
> enhancing the efficiency of the code.
>
> There is no need to subtract curr’s load from avg_load during runtime.
> Instead, we only need to calculate the incremental change and update
> avg_vruntime whenever curr’s time is updated.
>
> To better represent their functions, rename the original avg_vruntime and
> avg_load to tot_vruntime and tot_load, respectively, which more accurately
> describes their roles in the computation.
>
> Signed-off-by: Xavier <xavier_qy@....com>
This makes the code more complicated for no shown benefit.
Powered by blists - more mailing lists