From nobody Wed Jan  8 04:49:06 2025
Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com
 [209.85.218.51])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96EB120FA8F
	for <linux-kernel@vger.kernel.org>; Fri, 20 Dec 2024 19:28:33 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
 arc=none smtp.client-ip=209.85.218.51
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1734722917; cv=none;
 b=clp5jfcFwakPQiuHyF1vkmwK6liwoAV29SS0pkNrIEWQcuyQJkrXItCMzW5Yjy64FK1gPIWVstrkgZfE6eriFbSyTXHCp3Zbqt16O3DY3DjpA12+GEC0q2T6ZZR2n7c4F2coYpNpGfoXctJ4EzHGIyTjEe15OymIuztNqM+Z13I=
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1734722917; c=relaxed/simple;
	bh=vOKQgJxiDiH/fddbJGN1z1ZGn0vLN3reXMNcgKi1haA=;
	h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc;
 b=s3MOfoNKhDGktc3daOZKkdC3BltkjoD4KjIvIQNjMVRGtRY8C+WJofXztmk2jT7ze6/SPNXkLwgNBgrKbOweaFv+HI/5QKUP5Ea4qBnSYlJRU9rs/wspiDmXLaLBqdz0yfCBcRbqMTiEg8WA2vG7u7nudT342WKfRBy9JeXd6C0=
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
 dmarc=pass (p=none dis=none) header.from=linaro.org;
 spf=pass smtp.mailfrom=linaro.org;
 dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org
 header.b=SvDky/nE; arc=none smtp.client-ip=209.85.218.51
Authentication-Results: smtp.subspace.kernel.org;
 dmarc=pass (p=none dis=none) header.from=linaro.org
Authentication-Results: smtp.subspace.kernel.org;
 spf=pass smtp.mailfrom=linaro.org
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org
 header.b="SvDky/nE"
Received: by mail-ej1-f51.google.com with SMTP id
 a640c23a62f3a-aa670ffe302so431024466b.2
        for <linux-kernel@vger.kernel.org>;
 Fri, 20 Dec 2024 11:28:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1734722911; x=1735327711;
 darn=vger.kernel.org;
        h=cc:to:message-id:content-transfer-encoding:mime-version:subject
         :date:from:from:to:cc:subject:date:message-id:reply-to;
        bh=oCOgENOF44j3XSS+vQRJka00YGqoiag32fD1NAEFHvU=;
        b=SvDky/nE+QzsQPV64M9tuK5zwdS9m87WY/FfGnALhLdbX1stDWdxz1kf78yRxTJjlZ
         PaYFLoZuoVbQGjBeJZUukDQo+vp/m2ZjXDtdOlBz9d+EZFIdiyyYk//jH6RIsbyXqzdI
         v9rl4fTH1CekkLlmWtYSq3QQeaJFTIoLS/hW3H1Y90sIwjnBU7avDa3VEcho9eiNUjrg
         dgeohRyshcqUAo8n75wZjFmIXIs5CEx4MUzXCW3Ai9ZGbBxdw6dq6nblttWfkn22jt8L
         7HiNNtGtQMbRuDGpLwsFQDziHMbbzqReQQz0UU4W8q9OjWEK6cZgBbU3HtH+rnzGNDqU
         gmGg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1734722911; x=1735327711;
        h=cc:to:message-id:content-transfer-encoding:mime-version:subject
         :date:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=oCOgENOF44j3XSS+vQRJka00YGqoiag32fD1NAEFHvU=;
        b=e+YdBg88IPw4+vB5uH4S1sdqcM3Yd+W4+KE+0GFU6QUG/5jtoGPq2vlRWSaFILmipR
         RQIouIqxLDlVxofGTTtn+woNzkE0m5NLcxESdDsAFbor+QnxZKycVbxaG0/jma473aP1
         F/0mMia6hGBNsxOl/7QOmhRHnL+MHQXSGTmex8jsISqSx75pKebExrfzAUuPaw2A5M38
         61Lfa+cq5o2gGJMLvFp+itYp+BDBAj3x7drjwX+iGDI579wgvf5LgMt6bDECSoYNRU7V
         0A5vW1uD6QbSJZznPX8P/84tmW7974QGVwrsRbOWWwLsCHoYfYe61f4+wiA2+z5pkjq2
         p5Vw==
X-Gm-Message-State: AOJu0YyscrfHMqFUEUKqY91vNB9x8d/LySXhPPNIz0WhfJa6d9+oGePj
	Ppvzpo0E0X2gHQcYSYzMhxgOuJSz25qZNkX7wWdho7aw0iqcGIsiMvJUZ6Hi0+U=
X-Gm-Gg: ASbGncvQVN5X0v9Jt/QJcSQ+UhY2gdmjIkp2UjXbolYmcqeIzTMH7PIWEIPcXkQvTGy
	eVMpUtowKxRUFhhRr8dvHlqI1ySgTSYrxzfGq2sYgdGMPyzmVjcuhJ4tlLnz+IaAw5UObIg97Y5
	O64a+pSfHJQKcKs25ZsYvvDpFvFDn8FAVwSvpU9OoR6P56eIW9YieyspX9P/NhGpvoKCbtjfYVj
	GZzSdfkEto2++dBP3MleDjKJg7oan4nL7D2Rrcw33BWeW4RMdIHYvNfhmwe1XjMYa0=
X-Google-Smtp-Source: 
 AGHT+IEy/4GOlUZd6qAV5Tcpnj2W4ywP2vJhYC3ZdG9ZHml+9ppa/PFsr9C+EhIMkyJFBIXS3p6h5A==
X-Received: by 2002:a17:906:f5aa:b0:aab:f11f:f360 with SMTP id
 a640c23a62f3a-aac2874a92cmr363598066b.2.1734722911181;
        Fri, 20 Dec 2024 11:28:31 -0800 (PST)
Received: from [192.168.1.140] ([85.235.12.238])
        by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-aac0efe48aasm203846966b.112.2024.12.20.11.28.30
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Fri, 20 Dec 2024 11:28:30 -0800 (PST)
From: Linus Walleij <linus.walleij@linaro.org>
Date: Fri, 20 Dec 2024 20:28:29 +0100
Subject: [PATCH v3] sched/eevdf: Fix documentation to refer to EEVDF
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Message-Id: <20241220-eevdf-doc-v3-1-1e61fcc0265a@linaro.org>
X-B4-Tracking: v=1; b=H4sIAFzFZWcC/22MywrCMBBFf6VkbaSZJH248j/ERexM2wFpSiJBK
 f130y5EweW53HMWESkwRXEqFhEocWQ/ZdCHQnSjmwaSjJkFlGDKCqwkSthL9J0Ep5q6wtYQGZH
 /c6Cen3vrcs08cnz48NrTSW3rv0pSUklQFl1Lt1Zbc77z5II/+jCILZPgo6pSq28VstogGULb6
 L6qf9R1Xd/dLfJ53gAAAA==
X-Change-ID: 20240625-eevdf-doc-2a1876d94ee4
To: Ingo Molnar <mingo@redhat.com>, Peter Zijlstra <peterz@infradead.org>,
 Juri Lelli <juri.lelli@redhat.com>,
 Vincent Guittot <vincent.guittot@linaro.org>,
 Dietmar Eggemann <dietmar.eggemann@arm.com>,
 Steven Rostedt <rostedt@goodmis.org>, Ben Segall <bsegall@google.com>,
 Mel Gorman <mgorman@suse.de>,
 Daniel Bristot de Oliveira <bristot@redhat.com>,
 Valentin Schneider <vschneid@redhat.com>
Cc: linux-kernel@vger.kernel.org, Linus Walleij <linus.walleij@linaro.org>
X-Mailer: b4 0.14.2

The references to "CFS" is a bit misleading these days since
the scheduling principe is EEVDF.

Rewrite the top level comment, and trim other comments and
kerneldoc to implicitly refer to the scheduling implemented
in this file, or just "the fair scheduler".

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Changes in v3:
- Rebase on v6.13-rc1
- Link to v2: https://lore.kernel.org/r/20241031-eevdf-doc-v2-1-8de4ed583f6=
7@linaro.org

Changes in v2:
- Rebase on v6.12-rc1
- Tweak subject to make it more to the point
- Link to v1: https://lore.kernel.org/r/20240625-eevdf-doc-v1-1-215da9eb935=
4@linaro.org
---
 kernel/sched/fair.c | 31 +++++++++++++++++--------------
 1 file changed, 17 insertions(+), 14 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index fbdca89c677f416bc911d63b25372b7e3df5de8f..437134247c60b9ad45630455b82=
13a2354ae804c 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1,6 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Completely Fair Scheduling (CFS) Class (SCHED_NORMAL/SCHED_BATCH)
+ * Earliest Elegible Deadline First (EEVDF) Class (SCHED_NORMAL/SCHED_BATC=
H)
+ * also known as the fair time-sharing scheduler, refactored from the
+ * Completely Fair Scheduler (CFS).
  *
  *  Copyright (C) 2007 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
  *
@@ -17,7 +19,8 @@
  *  Scaled math optimizations by Thomas Gleixner
  *  Copyright (C) 2007, Thomas Gleixner <tglx@linutronix.de>
  *
- *  Adaptive scheduling granularity, math enhancements by Peter Zijlstra
+ *  Adaptive scheduling granularity, math enhancements and rewrite to EEVDF
+ *  by Peter Zijlstra
  *  Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra
  */
 #include <linux/energy_model.h>
@@ -297,7 +300,7 @@ static inline u64 calc_delta_fair(u64 delta, struct sch=
ed_entity *se)
 const struct sched_class fair_sched_class;
=20
 /**************************************************************
- * CFS operations on generic schedulable entities:
+ * Operations on generic schedulable entities:
  */
=20
 #ifdef CONFIG_FAIR_GROUP_SCHED
@@ -5686,7 +5689,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entit=
y *curr, int queued)
=20
=20
 /**************************************************
- * CFS bandwidth control machinery
+ * Bandwidth control machinery
  */
=20
 #ifdef CONFIG_CFS_BANDWIDTH
@@ -6800,7 +6803,7 @@ static inline void sched_fair_update_stop_tick(struct=
 rq *rq, struct task_struct
 #endif
=20
 /**************************************************
- * CFS operations on tasks:
+ * Operations on tasks:
  */
=20
 #ifdef CONFIG_SCHED_HRTICK
@@ -7962,7 +7965,7 @@ static int select_idle_sibling(struct task_struct *p,=
 int prev, int target)
 }
=20
 /**
- * cpu_util() - Estimates the amount of CPU capacity used by CFS tasks.
+ * cpu_util() - Estimates the amount of CPU capacity used by tasks.
  * @cpu: the CPU to get the utilization for
  * @p: task for which the CPU utilization should be predicted or NULL
  * @dst_cpu: CPU @p migrates to, -1 if @p moves from @cpu or @p =3D=3D NULL
@@ -7973,7 +7976,7 @@ static int select_idle_sibling(struct task_struct *p,=
 int prev, int target)
  *
  * CPU utilization is the sum of running time of runnable tasks plus the
  * recent utilization of currently non-runnable tasks on that CPU.
- * It represents the amount of CPU capacity currently used by CFS tasks in
+ * It represents the amount of CPU capacity currently used by tasks in
  * the range [0..max CPU capacity] with max CPU capacity being the CPU
  * capacity at f_max.
  *
@@ -7985,7 +7988,7 @@ static int select_idle_sibling(struct task_struct *p,=
 int prev, int target)
  * of such a task would be significantly decayed at this point of time.
  *
  * Boosted CPU utilization is defined as max(CPU runnable, CPU utilization=
).
- * CPU contention for CFS tasks can be detected by CPU runnable > CPU
+ * CPU contention for tasks can be detected by CPU runnable > CPU
  * utilization. Boosting is implemented in cpu_util() so that internal
  * users (e.g. EAS) can use it next to external users (e.g. schedutil),
  * latter via cpu_util_cfs_boost().
@@ -9725,7 +9728,7 @@ static bool __update_blocked_others(struct rq *rq, bo=
ol *done)
=20
 	/*
 	 * update_load_avg() can call cpufreq_update_util(). Make sure that RT,
-	 * DL and IRQ signals have been updated before updating CFS.
+	 * DL and IRQ signals have been updated before updating the scheduler.
 	 */
 	updated =3D update_other_load_avgs(rq);
=20
@@ -9876,7 +9879,7 @@ struct sg_lb_stats {
 	unsigned long group_util;		/* Total utilization   over the CPUs of the gr=
oup */
 	unsigned long group_runnable;		/* Total runnable time over the CPUs of th=
e group */
 	unsigned int sum_nr_running;		/* Nr of all tasks running in the group */
-	unsigned int sum_h_nr_running;		/* Nr of CFS tasks running in the group */
+	unsigned int sum_h_nr_running;		/* Nr of tasks running in the group */
 	unsigned int idle_cpus;                 /* Nr of idle CPUs         in the=
 group */
 	unsigned int group_weight;
 	enum group_type group_type;
@@ -10080,7 +10083,7 @@ static inline int sg_imbalanced(struct sched_group =
*group)
  * be used by some tasks.
  * We consider that a group has spare capacity if the number of task is
  * smaller than the number of CPUs or if the utilization is lower than the
- * available capacity for CFS tasks.
+ * available capacity for fairly scheduled tasks.
  * For the latter, we use a threshold to stabilize the state, to take into
  * account the variance of the tasks' load and to return true if the avail=
able
  * capacity in meaningful for the load balancer.
@@ -11570,7 +11573,7 @@ static int need_active_balance(struct lb_env *env)
 		return 1;
=20
 	/*
-	 * The dst_cpu is idle and the src_cpu CPU has only 1 CFS task.
+	 * The dst_cpu is idle and the src_cpu CPU has only 1 task.
 	 * It's worth migrating the task if the src_cpu's capacity is reduced
 	 * because of other sched_class or IRQs if more capacity stays
 	 * available on dst_cpu.
@@ -12316,7 +12319,7 @@ static void nohz_balancer_kick(struct rq *rq)
 	sd =3D rcu_dereference(rq->sd);
 	if (sd) {
 		/*
-		 * If there's a runnable CFS task and the current CPU has reduced
+		 * If there's a runnable task and the current CPU has reduced
 		 * capacity, kick the ILB to see if there's a better CPU to run on:
 		 */
 		if (rq->cfs.h_nr_running >=3D 1 && check_cpu_capacity(rq, sd)) {
@@ -12941,7 +12944,7 @@ static inline void task_tick_core(struct rq *rq, st=
ruct task_struct *curr)
 }
=20
 /*
- * se_fi_update - Update the cfs_rq->min_vruntime_fi in a CFS hierarchy if=
 needed.
+ * se_fi_update - Update the cfs_rq->min_vruntime_fi in the hierarchy if n=
eeded.
  */
 static void se_fi_update(const struct sched_entity *se, unsigned int fi_se=
q,
 			 bool forceidle)

---
base-commit: 40384c840ea1944d7c5a392e8975ed088ecf0b37
change-id: 20240625-eevdf-doc-2a1876d94ee4

Best regards,
--=20
Linus Walleij <linus.walleij@linaro.org>