From: Matthew Brost <matthew.brost@intel.com>
To: "Souza, Jose" <jose.souza@intel.com>
Cc: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
"Vivi, Rodrigo" <rodrigo.vivi@intel.com>
Subject: Re: [PATCH] drm/xe: Add process name and PID to job timedout message
Date: Thu, 11 Jul 2024 14:57:02 +0000 [thread overview]
Message-ID: <Zo/yvlpyIVRHusqj@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <03e127ecd193ea405a15c144f3adcccc226fa0bc.camel@intel.com>
On Thu, Jul 11, 2024 at 07:35:43AM -0600, Souza, Jose wrote:
> On Wed, 2024-07-10 at 23:41 +0000, Matthew Brost wrote:
> > On Wed, Jul 10, 2024 at 02:31:49PM -0700, José Roberto de Souza wrote:
> > > 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.
> > >
> >
> > Always for adding useful debug info...
> >
> > > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > > ---
> > > drivers/gpu/drm/xe/xe_guc_submit.c | 17 +++++++++++++++--
> > > 1 file changed, 15 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
> > > index 6392381e8e697..8604055271156 100644
> > > --- a/drivers/gpu/drm/xe/xe_guc_submit.c
> > > +++ b/drivers/gpu/drm/xe/xe_guc_submit.c
> > > @@ -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 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
> > > 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);
> >
> > We do something simliar in devcoredump_snapshot.
> >
> > Would it be worth while to have a helper like this?
> >
> > struct task_struct *task xe_exec_queue_get_pid_task(struct xe_exec_queue *q)
> > {
> > if (q->vm && q->vm->xef)
> > return get_pid_task(q->vm->xef->drm->pid, PIDTYPE_PID);;
> >
> > return NULL;
> > }
>
> I don't think it is worthy add a function for just 2 lines of code.
>
Typcially I agree but my counter here is we did have a bug for this [1]
so one point for this logic might be better.
Anyways I'm not going to block this patch on a bikeshed.
As is or with helper:
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
[1] https://patchwork.freedesktop.org/patch/596388/?series=134265&rev=1
> >
> > Matt
> >
> > > + 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))
> > > --
> > > 2.45.2
> > >
>
prev parent reply other threads:[~2024-07-11 14:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-10 21:31 [PATCH] drm/xe: Add process name and PID to job timedout message José Roberto de Souza
2024-07-10 21:37 ` ✓ CI.Patch_applied: success for " Patchwork
2024-07-10 21:37 ` ✓ CI.checkpatch: " Patchwork
2024-07-10 21:39 ` ✓ CI.KUnit: " Patchwork
2024-07-10 21:50 ` ✓ CI.Build: " Patchwork
2024-07-10 21:53 ` ✓ CI.Hooks: " Patchwork
2024-07-10 21:54 ` ✓ CI.checksparse: " Patchwork
2024-07-10 22:18 ` ✓ CI.BAT: " Patchwork
2024-07-10 23:27 ` ✗ CI.FULL: failure " Patchwork
2024-07-10 23:41 ` [PATCH] " Matthew Brost
2024-07-11 13:35 ` Souza, Jose
2024-07-11 14:57 ` Matthew Brost [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zo/yvlpyIVRHusqj@DUT025-TGLU.fm.intel.com \
--to=matthew.brost@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=jose.souza@intel.com \
--cc=rodrigo.vivi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox