From nobody Mon Dec 1 22:01:46 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 303572882D0 for ; Mon, 1 Dec 2025 06:47:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764571635; cv=none; b=FVxLOdAYUoImk/D0gdYR4ZyWfToN7q4x8Yg+4AanPaVwySqRyMtQKjg+dTNsmttXG6sk4WlxOys/QFJiZUN1W9aboKZ+zZ8CW6L4yg7zfRefAqxM9BiwSksoI1ugm4aPyUxKItuxtslGdSzqkyl87EzsO49o3wOc5FkdX4cYLHw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764571635; c=relaxed/simple; bh=1/FV31VI7KXAOzhNf02k0IfeyAjELjSFOs2YkzShm+Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pjf1rkTnvYNLIP0JX7z5iJjcSO5aGRiqVfB9x7dnFOT9YD70P0eTrQ2+BUJKFNhU17ZGrAgU9pnGc8JqVSfzViXF96NJBez1tAYjrx9KXDjZVLnQIqHf35ILoMdxk1hf8M37f6N7AeyVOiqTPd70UgcwGJNKgeLCRN9hv9jbDTU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JH7AZvsV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JH7AZvsV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2E06C116C6; Mon, 1 Dec 2025 06:47:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1764571634; bh=1/FV31VI7KXAOzhNf02k0IfeyAjELjSFOs2YkzShm+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JH7AZvsVgYhyl/YPl1NonwN+62uiEDIDT9VGySJXOkOZnWyQOtXH1iwNOBxnhBTkn 1C84JAFgjOlz8pPZHOb9KiI+YriuiKs09NFOabrf1E8xnytJ/rieOTDdGK5FXR0xrO ppDBjVVkMjSbOCiNmJPN4pcHtkQa7N9jZcegtw8WPa1OrnIqCcGibL19vfTAcleAc1 kZvf8EaUjhZLUs3Y6Ycnp4roT71gv7xyHw5OJbwmZuIDhNup9SWQlfew/UuXEgE9V6 S5Rx54m2keaW3Hc6VCX4ustfPMPYOh8cyWazdJJN65KD0WKh9ScuNTPsfUBWd8UiIv A2ywhAo/UmhHQ== From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Juri Lelli , Dietmar Eggemann , Valentin Schneider , Vincent Guittot , Shrikanth Hegde , Linus Torvalds , Mel Gorman , Steven Rostedt , Thomas Gleixner , Ingo Molnar Subject: [PATCH 4/6] sched/fair: Rename avg_vruntime() to cfs_avg_vruntime() Date: Mon, 1 Dec 2025 07:46:45 +0100 Message-ID: <20251201064647.1851919-5-mingo@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251201064647.1851919-1-mingo@kernel.org> References: <20251201064647.1851919-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since the unit of the ->avg_vruntime field isn't actually the same thing as the avg_vruntime() result, reduce confusion and rename the latter to the common cfs_*() nomenclature of visible global functions of the fair scheduler. Signed-off-by: Ingo Molnar --- kernel/sched/debug.c | 2 +- kernel/sched/fair.c | 10 +++++----- kernel/sched/sched.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index 41caa22e0680..a6ceda12bd35 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -829,7 +829,7 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct c= fs_rq *cfs_rq) SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "zero_vruntime", SPLIT_NS(zero_vruntime)); SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "avg_vruntime", - SPLIT_NS(avg_vruntime(cfs_rq))); + SPLIT_NS(cfs_avg_vruntime(cfs_rq))); SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "right_vruntime", SPLIT_NS(right_vruntime)); spread =3D right_vruntime - left_vruntime; diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 769d7b7990df..3d6d551168aa 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -651,7 +651,7 @@ void avg_vruntime_update(struct cfs_rq *cfs_rq, s64 del= ta) * Specifically: avg_runtime() + 0 must result in entity_eligible() :=3D t= rue * For this to be so, the result of this function must have a left bias. */ -u64 avg_vruntime(struct cfs_rq *cfs_rq) +u64 cfs_avg_vruntime(struct cfs_rq *cfs_rq) { struct sched_entity *curr =3D cfs_rq->curr; s64 avg =3D cfs_rq->avg_vruntime; @@ -696,7 +696,7 @@ static void update_entity_lag(struct cfs_rq *cfs_rq, st= ruct sched_entity *se) =20 WARN_ON_ONCE(!se->on_rq); =20 - vlag =3D avg_vruntime(cfs_rq) - se->vruntime; + vlag =3D cfs_avg_vruntime(cfs_rq) - se->vruntime; limit =3D calc_delta_fair(max_t(u64, 2*se->slice, TICK_NSEC), se); =20 se->vlag =3D clamp(vlag, -limit, limit); @@ -716,7 +716,7 @@ static void update_entity_lag(struct cfs_rq *cfs_rq, st= ruct sched_entity *se) * * lag_i >=3D 0 -> \Sum (v_i - v)*w_i >=3D (v_i - v)*(\Sum w_i) * - * Note: using 'avg_vruntime() > se->vruntime' is inaccurate due + * Note: using 'cfs_avg_vruntime() > se->vruntime' is inaccurate due * to the loss in precision caused by the division. */ static int vruntime_eligible(struct cfs_rq *cfs_rq, u64 vruntime) @@ -742,7 +742,7 @@ int entity_eligible(struct cfs_rq *cfs_rq, struct sched= _entity *se) =20 static void update_zero_vruntime(struct cfs_rq *cfs_rq) { - u64 vruntime =3D avg_vruntime(cfs_rq); + u64 vruntime =3D cfs_avg_vruntime(cfs_rq); s64 delta =3D (s64)(vruntime - cfs_rq->zero_vruntime); =20 avg_vruntime_update(cfs_rq, delta); @@ -5099,7 +5099,7 @@ void __setparam_fair(struct task_struct *p, const str= uct sched_attr *attr) static void place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags) { - u64 vslice, vruntime =3D avg_vruntime(cfs_rq); + u64 vslice, vruntime =3D cfs_avg_vruntime(cfs_rq); s64 lag =3D 0; =20 if (!se->custom_slice) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 6bfcf52a4840..47f7b6df634c 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -3956,7 +3956,7 @@ static inline void task_tick_mm_cid(struct rq *rq, st= ruct task_struct *curr) { } static inline void init_sched_mm_cid(struct task_struct *t) { } #endif /* !CONFIG_SCHED_MM_CID */ =20 -extern u64 avg_vruntime(struct cfs_rq *cfs_rq); +extern u64 cfs_avg_vruntime(struct cfs_rq *cfs_rq); extern int entity_eligible(struct cfs_rq *cfs_rq, struct sched_entity *se); static inline void move_queued_task_locked(struct rq *src_rq, struct rq *dst_rq, struct = task_struct *task) --=20 2.51.0