mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
sched_ext: Blame the DSQ's owning scheduler for a runnable stall
check_rq_for_timeouts() blames a runnable stall on the task's owner. Under a sub-scheduler hierarchy the stalled task can be sitting on a DSQ that a different scheduler has to drain, e.g. an ancestor's bypass DSQ while the owner is bypassing. The drainer then escapes blame while the owner is exited, and when the owner's exit is already claimed, nothing actionable is reported at all. Blame the DSQ's owning scheduler instead. The local DSQ is consumed by the cpu itself and keeps blame on the owner. Detection keeps the owner's timeout and single-scheduler behavior is unchanged. Reviewed-by: Andrea Righi <arighi@nvidia.com> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
b20dfde5ec
commit
2c91169377
|
|
@ -3391,8 +3391,19 @@ static bool check_rq_for_timeouts(struct rq *rq)
|
|||
|
||||
if (unlikely(time_after(jiffies,
|
||||
last_runnable + READ_ONCE(sch->watchdog_timeout)))) {
|
||||
struct scx_dispatch_q *dsq = READ_ONCE(p->scx.dsq);
|
||||
u32 dur_ms = jiffies_to_msecs(jiffies - last_runnable);
|
||||
|
||||
/*
|
||||
* A task can be stuck on a DSQ that a sched other than
|
||||
* its owner is responsible for draining, e.g. an
|
||||
* ancestor's bypass DSQ while the owner is bypassing.
|
||||
* Blame the drainer. The local DSQ is consumed by the
|
||||
* cpu itself and keeps blame on the owner.
|
||||
*/
|
||||
if (dsq && dsq->sched && dsq->id != SCX_DSQ_LOCAL)
|
||||
sch = dsq->sched;
|
||||
|
||||
__scx_exit(sch, SCX_EXIT_ERROR_STALL, 0, cpu_of(rq),
|
||||
"%s[%d] failed to run for %u.%03us",
|
||||
p->comm, p->pid, dur_ms / 1000,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user