Commit e67e3e7
sched/fair: Block delayed tasks on throttled hierarchy during dequeue
Dequeuing a fair task on a throttled hierarchy returns early on
encountering a throttled cfs_rq since the throttle path has already
dequeued the hierarchy above and has adjusted the h_nr_* accounting till
the root cfs_rq.
dequeue_entities() crucially misses calling __block_task() for delayed
tasks being dequeued on the throttled hierarchies, but this was mostly
harmless until commit b7ca574 ("sched/core: Tweak
wait_task_inactive() to force dequeue sched_delayed tasks") since all
existing cases would re-enqueue the task if task_on_rq_queued() returned
true and the task would eventually be blocked at pick after the
hierarchy was unthrottled.
wait_task_inactive() is special as it expects the delayed task on
throttled hierarchy to reach the blocked state on dequeue but since
__block_task() is never called, task_on_rq_queued() continues to return
true. Furthermore, since the task is now off the hierarchy, the pick
never reaches it to fully block the task even after unthrottle leading
to wait_task_inactive() looping endlessly.
Remedy this by calling __block_task() if a delayed task is being
dequeued on a throttled hierarchy.
This fix is only required for stabled kernels implementing delay dequeue
(>= v6.12) before v6.18 since upstream commit e1fad12 ("sched/fair:
Switch to task based throttle model") indirectly fixes this by removing
the early return conditions in dequeue_entities() as part of the per-task
throttle feature.
Cc: stable@vger.kernel.org
Reported-by: Matt Fleming <matt@readmodwrite.com>
Closes: https://lore.kernel.org/all/20250925133310.1843863-1-matt@readmodwrite.com/
Fixes: b7ca574 ("sched/core: Tweak wait_task_inactive() to force dequeue sched_delayed tasks")
Tested-by: Matt Fleming <mfleming@cloudflare.com>
Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 496b5ef commit e67e3e7
1 file changed
+6
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7187 | 7187 | | |
7188 | 7188 | | |
7189 | 7189 | | |
| 7190 | + | |
7190 | 7191 | | |
7191 | 7192 | | |
7192 | 7193 | | |
| |||
7218 | 7219 | | |
7219 | 7220 | | |
7220 | 7221 | | |
7221 | | - | |
| 7222 | + | |
7222 | 7223 | | |
7223 | 7224 | | |
7224 | 7225 | | |
| |||
7261 | 7262 | | |
7262 | 7263 | | |
7263 | 7264 | | |
7264 | | - | |
| 7265 | + | |
7265 | 7266 | | |
7266 | 7267 | | |
7267 | 7268 | | |
| |||
7273 | 7274 | | |
7274 | 7275 | | |
7275 | 7276 | | |
| 7277 | + | |
| 7278 | + | |
7276 | 7279 | | |
7277 | 7280 | | |
7278 | 7281 | | |
| |||
7288 | 7291 | | |
7289 | 7292 | | |
7290 | 7293 | | |
7291 | | - | |
| 7294 | + | |
7292 | 7295 | | |
7293 | 7296 | | |
7294 | 7297 | | |
| |||
0 commit comments