Re: [PATCH v13 33/36] sched/deadline: Keep a reaped deadline task in a rebuild
From: Mathieu Desnoyers
Date: Wed Dec 02 2026 - 09:55:01 EST
> Can the lockless check of p->dl.dl_bw race with __sched_setscheduler()
> admitting p to SCHED_DEADLINE?
Yes. In v14, dl_task_unhash() will test dl_bw under the rq lock.
release_task() will then take the rq lock of each task it reaps.
> If p migrates to another active CPU in the same root domain between
> release_task() and its final schedule in do_task_dead(), does
> dl_task_depart() leave a stale p->dl.dl_bw_cpu?
Yes. In v14, dl_task_depart() will record the CPU the task departs
from, even for a task already on the list. Also, if the CPU recorded is
inactive, dl_clear_root_domains() will no longer drop a task that still
runs in the class. It will count it on the CPU that the walk of the
task list would pick. It reads the task without its locks, so that CPU
can be wrong. The bandwidth then stays in that root domain until the
release, or the next rebuild.
> Can keeping an active exited task on dl_departed_list cause a rebuild to
> drop its bandwidth while it is still running in SCHED_DEADLINE?
Yes, for both cases. The second fix above covers the second case. For
the first case, dl_task_undepart() in v14 will set dl_bw_skip_gen. That
asks dl_clear_root_domains(), which ends the rebuild, to count the
task.
Thanks,
Mathieu