Skip to contentSkip to conversation

commit f3123c2590005 causes deadlocks

PATCH Bert Karwatzki 1 participant 1 message Nov 21, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Since linux-next-20231115 my linux system (debian sid on msi alpha 15 laptop) suffers from random deadlocks which can occur after 30 - 180min of usage. These deadlocks can be actively provoked by creating high system load (usually by compiling a kernel with make -j NRCPUS) and the opening instances of libreoffice --writer until the system GUI locks (the mouse cursor can still be moved but the screen is frozen). In this state ssh'ing into the machine is still possible and at least sometimes log messages about hung tasks appear in /var/log/kern.log.

More info can be found here:
https://gitlab.freedesktop.org/drm/amd/-/issues/2994

Using the method described to trigger the bug I bisected the problem in the linux-next and drm-misc trees to give commit f3123c2590005 as the problem. As this simple patch fixes the problem

(quoted diff) +0 -0

b/drivers/gpu/drm/scheduler/sched_main.c
index 044a8c4875ba..25b97db1b623 100644

drivers/gpu/drm/scheduler/sched_main.c +2 -3
@@ -1029,9 +1029,8 @@ EXPORT_SYMBOL(drm_sched_job_cleanup);
 void drm_sched_wakeup(struct drm_gpu_scheduler *sched,
                      struct drm_sched_entity *entity)
 {
-       if (drm_sched_entity_is_ready(entity))
-               if (drm_sched_can_queue(sched, entity))
-                       drm_sched_run_job_queue(sched);
+       if (drm_sched_can_queue(sched, entity))
+               drm_sched_run_job_queue(sched);
 }
 
 /**

there might be in the entity->dependency branch of drm_sched_entity_is_ready (some kind of circular dependencies ...).

Bert Karwatzki