]> www.infradead.org Git - users/hch/configfs.git/commitdiff
drm/xe: Add process name and PID to job timedout message
authorJosé Roberto de Souza <jose.souza@intel.com>
Wed, 10 Jul 2024 21:31:49 +0000 (14:31 -0700)
committerJosé Roberto de Souza <jose.souza@intel.com>
Thu, 11 Jul 2024 20:44:15 +0000 (13:44 -0700)
This will be very helpful for Mesa CI, where it uses PID to match
the exacly test that cause timedout/GPU hang and mark that test as
failing.

Also printing the process name as it might be relavant for human
readers.

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240710213149.57662-1-jose.souza@intel.com
drivers/gpu/drm/xe/xe_guc_submit.c

index 6392381e8e697ceab0de445e9d11bda98b4eed23..86040552711563a2ce31cd1c0132b163c1dff286 100644 (file)
@@ -1060,7 +1060,10 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
        struct xe_exec_queue *q = job->q;
        struct xe_gpu_scheduler *sched = &q->guc->sched;
        struct xe_guc *guc = exec_queue_to_guc(q);
+       const char *process_name = "no process";
+       struct task_struct *task = NULL;
        int err = -ETIME;
+       pid_t pid = -1;
        int i = 0;
        bool wedged, skip_timeout_check;
 
@@ -1157,9 +1160,19 @@ trigger_reset:
                goto sched_enable;
        }
 
-       xe_gt_notice(guc_to_gt(guc), "Timedout job: seqno=%u, lrc_seqno=%u, guc_id=%d, flags=0x%lx",
+       if (q->vm && q->vm->xef) {
+               task = get_pid_task(q->vm->xef->drm->pid, PIDTYPE_PID);
+               if (task) {
+                       process_name = task->comm;
+                       pid = task->pid;
+               }
+       }
+       xe_gt_notice(guc_to_gt(guc), "Timedout job: seqno=%u, lrc_seqno=%u, guc_id=%d, flags=0x%lx in %s [%d]",
                     xe_sched_job_seqno(job), xe_sched_job_lrc_seqno(job),
-                    q->guc->id, q->flags);
+                    q->guc->id, q->flags, process_name, pid);
+       if (task)
+               put_task_struct(task);
+
        trace_xe_sched_job_timedout(job);
 
        if (!exec_queue_killed(q))