[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250710094708.15443-1-zhangzihuan@kylinos.cn>
Date: Thu, 10 Jul 2025 17:47:08 +0800
From: Zihuan Zhang <zhangzihuan@...inos.cn>
To: Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>,
Mel Gorman <mgorman@...e.de>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Valentin Schneider <vschneid@...hat.com>,
linux-kernel@...r.kernel.org,
Vitalii Bursov <vitaly@...sov.com>
Cc: Joel Fernandes <joelagnelf@...dia.com>,
Tejun Heo <tj@...nel.org>,
David Vernet <void@...ifault.com>,
Andrea Righi <arighi@...dia.com>,
Changwoo Min <changwoo@...lia.com>,
Zihuan Zhang <zhangzihuan@...inos.cn>
Subject: [PATCH v1] sched/debug: Only print util_est when UTIL_EST feature is enabled
The /proc/{PID}/sched interface currently prints the util_est field
regardless of whether the UTIL_EST scheduling feature is enabled or not.
This can lead to confusion, as the value may not be meaningful when
UTIL_EST is disabled.
This patch makes the util_est field only appear when the UTIL_EST feature
is enabled via sched_feat. This avoids printing misleading or unused data.
Signed-off-by: Zihuan Zhang <zhangzihuan@...inos.cn>
---
kernel/sched/debug.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 9d71baf08075..a71ccb851e49 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -861,8 +861,9 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
cfs_rq->avg.runnable_avg);
SEQ_printf(m, " .%-30s: %lu\n", "util_avg",
cfs_rq->avg.util_avg);
- SEQ_printf(m, " .%-30s: %u\n", "util_est",
- cfs_rq->avg.util_est);
+ if (sched_feat(UTIL_EST))
+ SEQ_printf(m, " .%-30s: %u\n", "util_est",
+ cfs_rq->avg.util_est);
SEQ_printf(m, " .%-30s: %ld\n", "removed.load_avg",
cfs_rq->removed.load_avg);
SEQ_printf(m, " .%-30s: %ld\n", "removed.util_avg",
@@ -1259,7 +1260,8 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns,
P(se.avg.runnable_avg);
P(se.avg.util_avg);
P(se.avg.last_update_time);
- PM(se.avg.util_est, ~UTIL_AVG_UNCHANGED);
+ if (sched_feat(UTIL_EST))
+ PM(se.avg.util_est, ~UTIL_AVG_UNCHANGED);
#endif
#ifdef CONFIG_UCLAMP_TASK
__PS("uclamp.min", p->uclamp_req[UCLAMP_MIN].value);
--
2.25.1
Powered by blists - more mailing lists