From: Peter Zijlstra <peterz@infradead.org>
To: Xavier <xavier_qy@163.com>
Cc: mingo@redhat.com, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
vschneid@redhat.com, yu.c.chen@intel.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] sched/eevdf: Reduce the computation frequency of avg_vruntime
Date: Fri, 11 Oct 2024 10:52:01 +0200 [thread overview]
Message-ID: <20241011085201.GM17263@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20241011062449.998696-1-xavier_qy@163.com>
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@163.com>
This makes the code more complicated for no shown benefit.
next prev parent reply other threads:[~2024-10-11 8:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-12 9:14 [PATCH v1] sched/eevdf: Reduce the computation frequency of avg_vruntime Xavier
2024-09-26 6:03 ` Xavier
2024-10-11 6:11 ` [PATCH v2] " Xavier
2024-10-11 6:24 ` Xavier
2024-10-11 8:52 ` Peter Zijlstra [this message]
2024-10-11 11:48 ` Xavier
2024-10-17 4:47 ` kernel test robot
2024-10-18 14:52 ` [PATCH v3] sched/eevdf: Remove the consideration of the current task's time in vruntime_eligible() and avg_vruntime() Xavier
2024-10-25 7:13 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241011085201.GM17263@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=xavier_qy@163.com \
--cc=yu.c.chen@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox