[PATCH] sched/fair: Remove dead throttled check in pick_task_fair()

fangqiurong posted 1 patch 1 month, 4 weeks ago
kernel/sched/fair.c | 5 -----
1 file changed, 5 deletions(-)
[PATCH] sched/fair: Remove dead throttled check in pick_task_fair()
Posted by fangqiurong 1 month, 4 weeks ago
commit f666241e6bd5 ("sched/fair: Unify cfs_rq throttling via
account_cfs_rq_runtime()") removed the only assignment to @throttled in
the pick_task_fair() walk loop, making the variable and the trailing
task_throttle_setup_work() call dead code. Drop them.

No functional change.

Assisted-by: Z.ai:glm-5.2

Signed-off-by: fangqiurong <fangqiurong@kylinos.cn>
---
 kernel/sched/fair.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index bee6050a8f3a..967986212b43 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9941,7 +9941,6 @@ struct task_struct *pick_task_fair(struct rq *rq, struct rq_flags *rf)
 	struct sched_entity *se;
 	struct cfs_rq *cfs_rq;
 	struct task_struct *p;
-	bool throttled;
 	int new_tasks;
 
 again:
@@ -9949,8 +9948,6 @@ struct task_struct *pick_task_fair(struct rq *rq, struct rq_flags *rf)
 	if (!cfs_rq->nr_queued)
 		goto idle;
 
-	throttled = false;
-
 	do {
 		/* Might not have done put_prev_entity() */
 		if (cfs_rq->curr && cfs_rq->curr->on_rq)
@@ -9963,8 +9960,6 @@ struct task_struct *pick_task_fair(struct rq *rq, struct rq_flags *rf)
 	} while (cfs_rq);
 
 	p = task_of(se);
-	if (unlikely(throttled))
-		task_throttle_setup_work(p);
 	return p;
 
 idle:
-- 
2.43.0
Re: [PATCH] sched/fair: Remove dead throttled check in pick_task_fair()
Posted by K Prateek Nayak 1 month, 3 weeks ago
On 8/5/2026 7:09 AM, fangqiurong wrote:
> commit f666241e6bd5 ("sched/fair: Unify cfs_rq throttling via
> account_cfs_rq_runtime()") removed the only assignment to @throttled in
> the pick_task_fair() walk loop, making the variable and the trailing
> task_throttle_setup_work() call dead code. Drop them.

Thank you for catching my oversight. Looking at tip:sched/core,
Peter has already cleaned this up as a part of commit 85570f10a4c6
("sched/eevdf: Move to a single runqueue")

-- 
Thanks and Regards,
Prateek