Re: [PATCH v2 sched_ext/for-7.4-fixes] sched_ext: Don't skip NONE tasks in sched_ext_dead()
From: Tejun Heo
Date: Fri Dec 04 2026 - 10:37:12 EST
Applied to sched_ext/for-7.4-fixes with the following changes:
- The rq locking in sched_ext_dead() converted to
scoped_guard(task_rq_lock).
- Cc: stable@xxxxxxxxxxxxxxx # v7.1+ added.
--- a/kernel/sched/ext/ext.c
+++ b/kernel/sched/ext/ext.c
@@ -5032,9 +5032,6 @@ static bool task_dead_and_done(struct task_struct *p)
void sched_ext_dead(struct task_struct *p)
{
- struct rq_flags rf;
- struct rq *rq;
-
/*
* By the time control reaches here, @p has %TASK_DEAD set, switched out
* for the last time and then dropped the rq lock - task_dead_and_done()
@@ -5070,11 +5067,11 @@ void sched_ext_dead(struct task_struct *p)
* into ops; transition to %DEAD so the post-init recheck unwinds
* via scx_sub_init_cancel_task().
*/
- rq = task_rq_lock(p, &rf);
- if (scx_get_task_state(p) != SCX_TASK_INIT_BEGIN)
- scx_disable_and_exit_task(scx_task_sched(p), p);
- scx_set_task_state(p, SCX_TASK_DEAD);
- task_rq_unlock(rq, p, &rf);
+ scoped_guard(task_rq_lock, p) {
+ if (scx_get_task_state(p) != SCX_TASK_INIT_BEGIN)
+ scx_disable_and_exit_task(scx_task_sched(p), p);
+ scx_set_task_state(p, SCX_TASK_DEAD);
+ }
}
static void reweight_task_scx(struct rq *rq, struct task_struct *p,
Thanks.
--
tejun