lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20240103112914.77856-1-liusong@linux.alibaba.com>
Date: Wed,  3 Jan 2024 19:29:14 +0800
From: Liu Song <liusong@...ux.alibaba.com>
To: mingo@...hat.com,
	peterz@...radead.org,
	juri.lelli@...hat.com,
	vincent.guittot@...aro.org,
	dietmar.eggemann@....com,
	rostedt@...dmis.org,
	bsegall@...gle.com,
	mgorman@...e.de,
	bristot@...hat.com,
	vschneid@...hat.com
Cc: linux-kernel@...r.kernel.org,
	liusong@...ux.alibaba.com
Subject: [PATCH] sched/eevdf: remove the unused function max_vruntime and simplify the implementation of min_vruntime

The function max_vruntime is defined but not used, and under EEVDF,
there's no need to focus on max vruntime, so it's highly unlikely that
the function will be used in the future. Even if it were to be used,
max_vruntime simply returns the larger value of two vruntimes, and such
a naming convention could easily cause confusion, leading one to
mistakenly believe that alongside the meaningful concept of min_vruntime
in EEVDF, there might also be a concept of max_vruntime. Therefore, the
function should be removed.

Furthermore, since vruntime is monotonically increasing, the
implementation of the function min_vruntime has been simplified.

Signed-off-by: Liu Song <liusong@...ux.alibaba.com>
---
 kernel/sched/fair.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 533547e3c90a..0370e5d0be78 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -530,19 +530,9 @@ void account_cfs_rq_runtime(struct cfs_rq *cfs_rq, u64 delta_exec);
  * Scheduling class tree data structure manipulation methods:
  */
 
-static inline u64 max_vruntime(u64 max_vruntime, u64 vruntime)
-{
-	s64 delta = (s64)(vruntime - max_vruntime);
-	if (delta > 0)
-		max_vruntime = vruntime;
-
-	return max_vruntime;
-}
-
 static inline u64 min_vruntime(u64 min_vruntime, u64 vruntime)
 {
-	s64 delta = (s64)(vruntime - min_vruntime);
-	if (delta < 0)
+	if (vruntime < min_vruntime)
 		min_vruntime = vruntime;
 
 	return min_vruntime;
@@ -748,10 +738,8 @@ int entity_eligible(struct cfs_rq *cfs_rq, struct sched_entity *se)
 static u64 __update_min_vruntime(struct cfs_rq *cfs_rq, u64 vruntime)
 {
 	u64 min_vruntime = cfs_rq->min_vruntime;
-	/*
-	 * open coded max_vruntime() to allow updating avg_vruntime
-	 */
 	s64 delta = (s64)(vruntime - min_vruntime);
+
 	if (delta > 0) {
 		avg_vruntime_update(cfs_rq, delta);
 		min_vruntime = vruntime;
-- 
2.19.1.6.gb485710b


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ