Skip to contentSkip to conversation

sched_ext: Remove unused code in the do_pick_task_scx()

PATCH Applied Zqiang 4 participants 5 messages Dec 15, 2025

Subsystems (2)
lore
Share & tools
lore

Zqiang

author
#0 lore raw

PATCH 1/1 sched_ext: Remove unused code in the do_pick_task_scx()

The kick_idle variable is no longer used, this commit therefore remove it and also remove associated code in the do_pick_task_scx().

Fixes 4c95380701f5 ("sched/ext: Fold balance_scx() into pick_task_scx()"),
---
 kernel/sched/ext.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
kernel/sched/ext.c +2 -6
index 695503a2f7d1..94164f2dec6d 100644
@@ -2446,7 +2446,7 @@ static struct task_struct *
 do_pick_task_scx(struct rq *rq, struct rq_flags *rf, bool force_scx)
 {
 	struct task_struct *prev = rq->curr;
-	bool keep_prev, kick_idle = false;
+	bool keep_prev;
 	struct task_struct *p;
 
 	/* see kick_cpus_irq_workfn() */
@@ -2488,12 +2488,8 @@ do_pick_task_scx(struct rq *rq, struct rq_flags *rf, bool force_scx)
 			refill_task_slice_dfl(rcu_dereference_sched(scx_root), p);
 	} else {
 		p = first_local_task(rq);
-		if (!p) {
-			if (kick_idle)
-				scx_kick_cpu(rcu_dereference_sched(scx_root),
-					     cpu_of(rq), SCX_KICK_IDLE);
+		if (!p)
 			return NULL;
-		}
 
 		if (unlikely(!p->scx.slice)) {
 			struct scx_sched *sch = rcu_dereference_sched(scx_root);
Signature · 1 line
2.17.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Zqiang

The kick_idle variable is no longer used, this commit therefore remove it and also remove associated code in the do_pick_task_scx().

Fixes 4c95380701f5 ("sched/ext: Fold balance_scx() into pick_task_scx()"),

nit: drop the comma at the end of the line.

Apart than that, looks good to me, thanks for the cleanup.

-Andrea

Quoted 35 lines
---
 kernel/sched/ext.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
kernel/sched/ext.c +2 -6
index 695503a2f7d1..94164f2dec6d 100644
@@ -2446,7 +2446,7 @@ static struct task_struct *
 do_pick_task_scx(struct rq *rq, struct rq_flags *rf, bool force_scx)
 {
 	struct task_struct *prev = rq->curr;
-	bool keep_prev, kick_idle = false;
+	bool keep_prev;
 	struct task_struct *p;
 
 	/* see kick_cpus_irq_workfn() */
@@ -2488,12 +2488,8 @@ do_pick_task_scx(struct rq *rq, struct rq_flags *rf, bool force_scx)
 			refill_task_slice_dfl(rcu_dereference_sched(scx_root), p);
 	} else {
 		p = first_local_task(rq);
-		if (!p) {
-			if (kick_idle)
-				scx_kick_cpu(rcu_dereference_sched(scx_root),
-					     cpu_of(rq), SCX_KICK_IDLE);
+		if (!p)
 			return NULL;
-		}
 
 		if (unlikely(!p->scx.slice)) {
 			struct scx_sched *sch = rcu_dereference_sched(scx_root);
Signature · 1 line
2.17.1
#2 lore raw
In reply to Zqiang
Quoted 5 lines · Zqiang

The kick_idle variable is no longer used, this commit therefore remove it and also remove associated code in the do_pick_task_scx().

Fixes 4c95380701f5 ("sched/ext: Fold balance_scx() into pick_task_scx()"),

The change seems reasonable, but why is there a fixes up? This is followup cleanup, the original patch is perfectly fine.

Quoted 31 lines
---
 kernel/sched/ext.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
kernel/sched/ext.c +2 -6
index 695503a2f7d1..94164f2dec6d 100644
@@ -2446,7 +2446,7 @@ static struct task_struct *
 do_pick_task_scx(struct rq *rq, struct rq_flags *rf, bool force_scx)
 {
 	struct task_struct *prev = rq->curr;
-	bool keep_prev, kick_idle = false;
+	bool keep_prev;
 	struct task_struct *p;
 
 	/* see kick_cpus_irq_workfn() */
@@ -2488,12 +2488,8 @@ do_pick_task_scx(struct rq *rq, struct rq_flags *rf, bool force_scx)
 			refill_task_slice_dfl(rcu_dereference_sched(scx_root), p);
 	} else {
 		p = first_local_task(rq);
-		if (!p) {
-			if (kick_idle)
-				scx_kick_cpu(rcu_dereference_sched(scx_root),
-					     cpu_of(rq), SCX_KICK_IDLE);
+		if (!p)
 			return NULL;
-		}
 
 		if (unlikely(!p->scx.slice)) {
 			struct scx_sched *sch = rcu_dereference_sched(scx_root);
Reviewed-by
#3 lore raw
Quoted 10 lines · Emil Tsalapatis
Quoted 5 lines · Zqiang

The kick_idle variable is no longer used, this commit therefore remove it and also remove associated code in the do_pick_task_scx().

Fixes 4c95380701f5 ("sched/ext: Fold balance_scx() into pick_task_scx()"),

The change seems reasonable, but why is there a fixes up? This is followup cleanup, the original patch is perfectly fine.

Oh and of course tag aside:

Quoted 31 lines
Quoted 31 lines
---
 kernel/sched/ext.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
kernel/sched/ext.c +2 -6
index 695503a2f7d1..94164f2dec6d 100644
@@ -2446,7 +2446,7 @@ static struct task_struct *
 do_pick_task_scx(struct rq *rq, struct rq_flags *rf, bool force_scx)
 {
 	struct task_struct *prev = rq->curr;
-	bool keep_prev, kick_idle = false;
+	bool keep_prev;
 	struct task_struct *p;
 
 	/* see kick_cpus_irq_workfn() */
@@ -2488,12 +2488,8 @@ do_pick_task_scx(struct rq *rq, struct rq_flags *rf, bool force_scx)
 			refill_task_slice_dfl(rcu_dereference_sched(scx_root), p);
 	} else {
 		p = first_local_task(rq);
-		if (!p) {
-			if (kick_idle)
-				scx_kick_cpu(rcu_dereference_sched(scx_root),
-					     cpu_of(rq), SCX_KICK_IDLE);
+		if (!p)
 			return NULL;
-		}
 
 		if (unlikely(!p->scx.slice)) {
 			struct scx_sched *sch = rcu_dereference_sched(scx_root);
reviewer Applied
#4 lore raw
In reply to Zqiang

Applied to sched_ext/for-6.19-fixes with the Fixes tag (and trailing comma) dropped.

Thanks.

--
tejun