dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/scheduler: Fix sched hang when killing app with dependent jobs
@ 2025-07-10  6:36 Lin.Cao
  2025-07-10  7:52 ` Christian König
  0 siblings, 1 reply; 5+ messages in thread
From: Lin.Cao @ 2025-07-10  6:36 UTC (permalink / raw)
  To: dri-devel, amd-gfx; +Cc: zhenguo.yin, Emily.Deng, Christian König, Lin.Cao

When Application A submits jobs (a1, a2, a3) and application B submits
job b1 with a dependency on a2's scheduler fence, killing application A
before run_job(a1) causes drm_sched_entity_kill_jobs_work() to force
signal all jobs sequentially. However, due to missing work_run_job or
work_free_job in entity_kill_job_work(), the scheduler enters sleep
state, causing application B hang.

Add drm_sched_wakeup() when entity_kill_job_work() to preventing
scheduler sleep and subsequent application hangs.

Signed-off-by: Lin.Cao <lincao12@amd.com>
---
 drivers/gpu/drm/scheduler/sched_entity.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c
index e671aa241720..a22b0f65558a 100644
--- a/drivers/gpu/drm/scheduler/sched_entity.c
+++ b/drivers/gpu/drm/scheduler/sched_entity.c
@@ -180,6 +180,7 @@ static void drm_sched_entity_kill_jobs_work(struct work_struct *wrk)
 	drm_sched_fence_finished(job->s_fence, -ESRCH);
 	WARN_ON(job->s_fence->parent);
 	job->sched->ops->free_job(job);
+	drm_sched_wakeup(job->sched);
 }
 
 /* Signal the scheduler finished fence when the entity in question is killed. */
-- 
2.46.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-07-11 13:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-10  6:36 [PATCH] drm/scheduler: Fix sched hang when killing app with dependent jobs Lin.Cao
2025-07-10  7:52 ` Christian König
2025-07-10  8:33   ` cao, lin
2025-07-11 13:13     ` Philipp Stanner
2025-07-11 13:24       ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).