public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: John Harrison <John.C.Harrison@Intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Add process identifier to requests
Date: Fri, 13 Feb 2015 16:24:36 +0000	[thread overview]
Message-ID: <54DE2544.8000909@Intel.com> (raw)
In-Reply-To: <20150211152926.GB2749@nuc-i3427.alporthouse.com>

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@whitecape.org>
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
>> ---
>>   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. Thus the recorded pid would be the kernel worker thread 
not the user land application. Is there any particular reason why the 
pid could not be recorded when the request is first created rather than 
when it is submitted?

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2015-02-13 16:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-11 14:50 [PATCH] drm/i915: Add process identifier to requests Mika Kuoppala
2015-02-11 15:29 ` Chris Wilson
2015-02-12  8:26   ` Mika Kuoppala
2015-02-12  8:51     ` Chris Wilson
2015-02-12  9:35       ` Daniel Vetter
2015-02-13 10:41     ` shuang.he
2015-02-13 16:24   ` John Harrison [this message]
2015-02-13 16:54     ` Chris Wilson
2015-02-12  6:49 ` shuang.he

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=54DE2544.8000909@Intel.com \
    --to=john.c.harrison@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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