Re: [PATCH] drm/i915: Add process identifier to requests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 13, 2015 at 04:24:36PM +0000, John Harrison wrote:
> On 11/02/2015 15:29, Chris Wilson wrote:
> >On Wed, Feb 11, 2015 at 04:50:14PM +0200, Mika Kuoppala wrote:
> >>We use the pid of the process which opened our device when
> >>we track which was the culprit of the gpu hang. But as that
> >>file descriptor might get inherited, we might blame the
> >>wrong process when we record the error state.
> >>
> >>Track process identifiers in requests to always find
> >>the correct offender.
> >>
> >>Cc: Kenneth Graunke <kenneth@xxxxxxxxxxxxx>
> >>Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> >>Signed-off-by: Mika Kuoppala <mika.kuoppala@xxxxxxxxx>
> >>---
> >>  drivers/gpu/drm/i915/i915_drv.h       | 3 +++
> >>  drivers/gpu/drm/i915/i915_gem.c       | 3 +++
> >>  drivers/gpu/drm/i915/i915_gpu_error.c | 5 ++---
> >>  3 files changed, 8 insertions(+), 3 deletions(-)
> >>
> >>diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> >>index c0b8644..9093654 100644
> >>--- a/drivers/gpu/drm/i915/i915_drv.h
> >>+++ b/drivers/gpu/drm/i915/i915_drv.h
> >>@@ -2153,6 +2153,9 @@ struct drm_i915_gem_request {
> >>  	/** file_priv list entry for this request */
> >>  	struct list_head client_list;
> >>+	/** process identifier submitting this request */
> >>+	struct pid *pid;
> >>+
> >>  	uint32_t uniq;
> >>  	/**
> >>diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> >>index c26d36c..47affaf 100644
> >>--- a/drivers/gpu/drm/i915/i915_gem.c
> >>+++ b/drivers/gpu/drm/i915/i915_gem.c
> >>@@ -2483,6 +2483,7 @@ int __i915_add_request(struct intel_engine_cs *ring,
> >>  	request->emitted_jiffies = jiffies;
> >>  	list_add_tail(&request->list, &ring->request_list);
> >>  	request->file_priv = NULL;
> >>+	request->pid = get_pid(task_pid(current));
> >>  	if (file) {
> >I would suggest you only track processes for requests submitted by
> >userspace. Then if there is no associated pid, we know that the kernel
> >was in control (and not stuck figuring out if kworker was acting on
> >behalf of the user or the kernel).
> >-Chris
> >
> 
> With the GPU scheduler, the actual batch buffer submission via
> i915_add_request() could be disconnected from the original IOCTL
> call into the driver.

However, with requests i915_add_request() should have been replaced by a
engine/scheduler vfunc. The request is constucted from the execbuffer,
thus can be associated with the user process. The request is then
submitted intact to the scheduler for queueing for submission to the
hardware.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux