Skip to contentSkip to conversation

sched_ext: Add migration-disabled counter to error state dump

PATCH Superseded Andrea Righi 2 participants 3 messages Sep 18, 2025

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Andrea Righi

author reviewer
#0 lore raw

PATCH 1/1 sched_ext: Add migration-disabled counter to error state dump

Include the task's migration-disabled counter when dumping task state during an error exit.

This can help diagnose cases where tasks can get stuck, because they're unable to migrate elsewhere.

---
 kernel/sched/ext.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/sched/ext.c +2 -1
index 477eccf023388..e03bb51364661 100644
@@ -4167,7 +4167,8 @@ static void scx_dump_task(struct seq_buf *s, struct scx_dump_ctx *dctx,
 		  p->scx.sticky_cpu, p->scx.holding_cpu, dsq_id_buf);
 	dump_line(s, "      dsq_vtime=%llu slice=%llu weight=%u",
 		  p->scx.dsq_vtime, p->scx.slice, p->scx.weight);
-	dump_line(s, "      cpus=%*pb", cpumask_pr_args(p->cpus_ptr));
+	dump_line(s, "      cpus=%*pb migration_disabled=%u", cpumask_pr_args(p->cpus_ptr),
+		  p->migration_disabled);
 
 	if (SCX_HAS_OP(sch, dump_task)) {
 		ops_dump_init(s, "    ");
Signature · 1 line
2.51.0
reviewer
#1 lore raw

Hello,

Quoted 16 lines · Andrea Righi

Include the task's migration-disabled counter when dumping task state during an error exit.

This can help diagnose cases where tasks can get stuck, because they're unable to migrate elsewhere.

---
 kernel/sched/ext.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/sched/ext.c +0 -0
index 477eccf023388..e03bb51364661 100644

kernel/sched/ext.c static void scx_dump_task(struct seq_buf *s, struct scx_dump_ctx *dctx, · line 4170

Quoted 5 lines
kernel/sched/ext.c +1 -1
@@ -4167,7 +4167,8 @@ static void scx_dump_task(struct seq_buf *s, struct scx_dump_ctx *dctx,
 		  p->scx.sticky_cpu, p->scx.holding_cpu, dsq_id_buf);
 	dump_line(s, "      dsq_vtime=%llu slice=%llu weight=%u",
 		  p->scx.dsq_vtime, p->scx.slice, p->scx.weight);
-	dump_line(s, "      cpus=%*pb", cpumask_pr_args(p->cpus_ptr));
+	dump_line(s, "      cpus=%*pb migration_disabled=%u", cpumask_pr_args(p->cpus_ptr),

Can you abbreviate this a bit? We have limited dump buffer size and real estate. Wouldn't e.g. no_mig= achieve the same with a lot less space?

Thanks.

Signature · 1 line
tejun
author reviewer
#2 lore raw
Quoted 14 lines · Tejun Heo

Hello,

Quoted 11 lines · Andrea Righi

Include the task's migration-disabled counter when dumping task state during an error exit.

This can help diagnose cases where tasks can get stuck, because they're unable to migrate elsewhere.

---
 kernel/sched/ext.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 13 lines

kernel/sched/ext.c static void scx_dump_task(struct seq_buf *s, struct scx_dump_ctx *dctx, · line 4170

Quoted 10 lines
kernel/sched/ext.c +1 -1
index 477eccf023388..e03bb51364661 100644
@@ -4167,7 +4167,8 @@ static void scx_dump_task(struct seq_buf *s, struct scx_dump_ctx *dctx,
 		  p->scx.sticky_cpu, p->scx.holding_cpu, dsq_id_buf);
 	dump_line(s, "      dsq_vtime=%llu slice=%llu weight=%u",
 		  p->scx.dsq_vtime, p->scx.slice, p->scx.weight);
-	dump_line(s, "      cpus=%*pb", cpumask_pr_args(p->cpus_ptr));
+	dump_line(s, "      cpus=%*pb migration_disabled=%u", cpumask_pr_args(p->cpus_ptr),

Can you abbreviate this a bit? We have limited dump buffer size and real estate. Wouldn't e.g. no_mig= achieve the same with a lot less space?

Oh yes, good point. I think no_mig= is clear enough, or even nomig=. And if it isn't clear, people can always check the code to see what it refers to.

Will send a v2 with this change.

Thanks,
-Andrea