[tip: sched/urgent] sched/debug: Provide slice length for fair tasks

From: tip-bot2 for Christian Loehle
Date: Fri Jan 31 2025 - 05:00:57 EST


The following commit has been merged into the sched/urgent branch of tip:

Commit-ID: 9065ce69754dece78606c8bbb3821449272e56bf
Gitweb: https://git.kernel.org/tip/9065ce69754dece78606c8bbb3821449272e56bf
Author: Christian Loehle <christian.loehle@xxxxxxx>
AuthorDate: Wed, 29 Jan 2025 17:59:44
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitterDate: Fri, 31 Jan 2025 10:45:33 +01:00

sched/debug: Provide slice length for fair tasks

Since commit:

857b158dc5e8 ("sched/eevdf: Use sched_attr::sched_runtime to set request/slice suggestion")

... we have the userspace per-task tunable slice length, which is
a key parameter that is otherwise difficult to obtain, so provide
it in /proc/$PID/sched.

[ mingo: Clarified the changelog. ]

Signed-off-by: Christian Loehle <christian.loehle@xxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Link: https://lore.kernel.org/r/453349b1-1637-42f5-a7b2-2385392b5956@xxxxxxx
---
kernel/sched/debug.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index a1be00a..5b32d3c 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -1265,6 +1265,8 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns,
if (task_has_dl_policy(p)) {
P(dl.runtime);
P(dl.deadline);
+ } else if (fair_policy(p->policy)) {
+ P(se.slice);
}
#ifdef CONFIG_SCHED_CLASS_EXT
__PS("ext.enabled", task_on_scx(p));