mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched/debug: Print slice length for fair tasks
@ 2025-01-29 17:59 Christian Loehle
  2025-01-29 18:04 ` Christian Loehle
  2025-01-31 10:00 ` [tip: sched/urgent] sched/debug: Provide " tip-bot2 for Christian Loehle
  0 siblings, 2 replies; 3+ messages in thread
From: Christian Loehle @ 2025-01-29 17:59 UTC (permalink / raw)
  To: linux-kernel, Peter Zijlstra
  Cc: Ingo Molnar, Juri Lelli, Steven Rostedt, Vincent Guittot,
	Valentin Schneider, Petre-Ionut Tudor

With commit 857b158dc5e8 ("sched/eevdf: Use sched_attr::sched_runtime
to set request/slice suggestion") we have the userspace per-task tunable
slice length so print it in /proc/$PID/sched.

Signed-off-by: Christian Loehle <christian.loehle@arm.com>
---
 kernel/sched/debug.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index fd7e85220715..ef047add7f9e 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -1262,6 +1262,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));
-- 
2.34.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sched/debug: Print slice length for fair tasks
  2025-01-29 17:59 [PATCH] sched/debug: Print slice length for fair tasks Christian Loehle
@ 2025-01-29 18:04 ` Christian Loehle
  2025-01-31 10:00 ` [tip: sched/urgent] sched/debug: Provide " tip-bot2 for Christian Loehle
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Loehle @ 2025-01-29 18:04 UTC (permalink / raw)
  To: linux-kernel, Peter Zijlstra
  Cc: Ingo Molnar, Juri Lelli, Steven Rostedt, Vincent Guittot,
	Valentin Schneider, Petre-Ionut Tudor

On 1/29/25 17:59, Christian Loehle wrote:
> With commit 857b158dc5e8 ("sched/eevdf: Use sched_attr::sched_runtime
> to set request/slice suggestion") we have the userspace per-task tunable
> slice length so print it in /proc/$PID/sched.
> 
> Signed-off-by: Christian Loehle <christian.loehle@arm.com>
> ---
>  kernel/sched/debug.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
> index fd7e85220715..ef047add7f9e 100644
> --- a/kernel/sched/debug.c
> +++ b/kernel/sched/debug.c
> @@ -1262,6 +1262,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));

So Peter added a debug slice length print for all tasks on
the rq in commit ("147f3efaa241 sched/fair: Implement an EEVDF-like
scheduling policy") already, but that alone is a bit awkward to play
with when modifying slice length for specific tasks which aren't
always enqueued.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip: sched/urgent] sched/debug: Provide slice length for fair tasks
  2025-01-29 17:59 [PATCH] sched/debug: Print slice length for fair tasks Christian Loehle
  2025-01-29 18:04 ` Christian Loehle
@ 2025-01-31 10:00 ` tip-bot2 for Christian Loehle
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Christian Loehle @ 2025-01-31 10:00 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Christian Loehle, Ingo Molnar, Peter Zijlstra, x86, linux-kernel

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@arm.com>
AuthorDate:    Wed, 29 Jan 2025 17:59:44 
Committer:     Ingo Molnar <mingo@kernel.org>
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@arm.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/453349b1-1637-42f5-a7b2-2385392b5956@arm.com
---
 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));

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-01-31 10:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-29 17:59 [PATCH] sched/debug: Print slice length for fair tasks Christian Loehle
2025-01-29 18:04 ` Christian Loehle
2025-01-31 10:00 ` [tip: sched/urgent] sched/debug: Provide " tip-bot2 for Christian Loehle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®