aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_guc_submit.c
diff options
context:
space:
mode:
authorMatthew Brost <matthew.brost@intel.com>2024-07-23 08:10:45 -0700
committerMatthew Brost <matthew.brost@intel.com>2024-07-23 10:45:40 -0700
commit8af13c3fc1259c1b8cfc4459d3701fcf41ad74df (patch)
treec18276b6997bb1e6600b5e8d71d6f001987175f9 /drivers/gpu/drm/xe/xe_guc_submit.c
parentc8a31ff6199f12ca65d73f1235117c1d9e6365a9 (diff)
drm/xe: Store process name and pid in xe file
An xe file can outlive the associated process as the GPU cleanup is just triggered upon file close (process kill) and completes sometime later. If the file close triggers error conditions (GPU hangs) the process cannot be safely referenced to retrieve the name and pid for debug information. Store the process name and pid directly in the xe file to be safe. v2: - Access file->pid via rcu_access_pointer (Matthew Auld) Fixes: b10d0c5e9df7 ("drm/xe: Add process name to devcoredump") Fixes: f6ca930d974e ("drm/xe: Add process name and PID to job timedout message") Signed-off-by: Matthew Brost <matthew.brost@intel.com> Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240723151045.1725417-1-matthew.brost@intel.com
Diffstat (limited to 'drivers/gpu/drm/xe/xe_guc_submit.c')
-rw-r--r--drivers/gpu/drm/xe/xe_guc_submit.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index da2ead86b9ae..a4570631926f 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -1072,7 +1072,6 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
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;
@@ -1172,17 +1171,12 @@ trigger_reset:
}
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;
- }
+ process_name = q->vm->xef->process_name;
+ pid = q->vm->xef->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, process_name, pid);
- if (task)
- put_task_struct(task);
trace_xe_sched_job_timedout(job);