Skip to content

Commit af99dee

Browse files
committed
sched/deadline: Don't count nr_running for dl_server proxy tasks
JIRA: https://issues.redhat.com/browse/RHEL-110301 commit 52d1552 Author: Yicong Yang <yangyicong@hisilicon.com> Date: Fri Jun 27 11:54:20 2025 +0800 sched/deadline: Don't count nr_running for dl_server proxy tasks On CPU offline the kernel stalled with below call trace: INFO: task kworker/0:1:11 blocked for more than 120 seconds. cpuhp hold the cpu hotplug lock endless and stalled vmstat_shepherd. This is because we count nr_running twice on cpuhp enqueuing and failed the wait condition of cpuhp: enqueue_task_fair() // pick cpuhp from idle, rq->nr_running = 0 dl_server_start() [...] add_nr_running() // rq->nr_running = 1 add_nr_running() // rq->nr_running = 2 [switch to cpuhp, waiting on balance_hotplug_wait()] rcuwait_wait_event(rq->nr_running == 1 && ...) // failed, rq->nr_running=2 schedule() // wait again It doesn't make sense to count the dl_server towards runnable tasks, since it runs other tasks. Fixes: 63ba842 ("sched/deadline: Introduce deadline servers") Signed-off-by: Yicong Yang <yangyicong@hisilicon.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20250627035420.37712-1-yangyicong@huawei.com Signed-off-by: Phil Auld <pauld@redhat.com>
1 parent 3fe11cd commit af99dee

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

kernel/sched/deadline.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1851,7 +1851,9 @@ void inc_dl_tasks(struct sched_dl_entity *dl_se, struct dl_rq *dl_rq)
18511851
u64 deadline = dl_se->deadline;
18521852

18531853
dl_rq->dl_nr_running++;
1854-
add_nr_running(rq_of_dl_rq(dl_rq), 1);
1854+
1855+
if (!dl_server(dl_se))
1856+
add_nr_running(rq_of_dl_rq(dl_rq), 1);
18551857

18561858
inc_dl_deadline(dl_rq, deadline);
18571859
}
@@ -1861,7 +1863,9 @@ void dec_dl_tasks(struct sched_dl_entity *dl_se, struct dl_rq *dl_rq)
18611863
{
18621864
WARN_ON(!dl_rq->dl_nr_running);
18631865
dl_rq->dl_nr_running--;
1864-
sub_nr_running(rq_of_dl_rq(dl_rq), 1);
1866+
1867+
if (!dl_server(dl_se))
1868+
sub_nr_running(rq_of_dl_rq(dl_rq), 1);
18651869

18661870
dec_dl_deadline(dl_rq, dl_se->deadline);
18671871
}

0 commit comments

Comments
 (0)