public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
To: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/perf: Refactor oa object to better manage resources
Date: Wed, 15 May 2019 10:11:34 +0100	[thread overview]
Message-ID: <46f258bd-ac0a-94d2-2acd-9ffdcabbaa85@intel.com> (raw)
In-Reply-To: <20190514181400.GA8091@localhost.localdomain>

On 14/05/2019 19:14, Umesh Nerlige Ramappa wrote:
> On Tue, May 14, 2019 at 10:34:49AM +0100, Lionel Landwerlin wrote:
>> Hi Umesh,
>>
>> I just noticed this different between v1 & v2.
>> My understanding is that if destroy() is called, stream should be the 
>> same as dev_priv->perf.exclusive_stream.
>> If it's not it sounds like a bug. So why change this?
>>
> v2 fixes only checkpatch warnings. it warned on use of BUG_ON. BUG_ON 
> is intended to crash the system in severe cases where the 
> driver/kernel is unusable. In this case, the mismatch between user 
> passed information and exclusive_stream may not require a crash.


This is called from i915_perf_release() which is attached to the 
i915-perf file descriptor only in i915_perf.c.

If we managed to reach that function it must be because the file 
descriptor given by userspace is associated to the i915-perf stream.

Having stream != dev_priv->perf.exclusive_stream means that we probably 
screwed up the locking somewhere in this file.

So I would argue this is a kernel issue, not a user issue and that using 
BUG_ON() is justified.


Thanks,


-Lionel


>> -Lionel
>>
>> On 03/05/2019 00:13, Umesh Nerlige Ramappa wrote:
>>>  static void i915_oa_stream_destroy(struct i915_perf_stream *stream)
>>>  {
>>>      struct drm_i915_private *dev_priv = stream->dev_priv;
>>> -    BUG_ON(stream != dev_priv->perf.oa.exclusive_stream);
>>> +    if (stream != dev_priv->perf.exclusive_stream) {
>>> +        WARN_ON_ONCE(stream != dev_priv->perf.exclusive_stream);
>>> +        return;
>>> +    }
>>>      /*
>>
>>
>

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

  reply	other threads:[~2019-05-15  9:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-02 23:13 [PATCH] drm/i915/perf: Refactor oa object to better manage resources Umesh Nerlige Ramappa
2019-05-02 23:32 ` ✗ Fi.CI.SPARSE: warning for drm/i915/perf: Refactor oa object to better manage resources (rev2) Patchwork
2019-05-03  0:00 ` ✓ Fi.CI.BAT: success " Patchwork
2019-05-03  6:17 ` ✓ Fi.CI.IGT: " Patchwork
2019-05-14  9:34 ` [PATCH] drm/i915/perf: Refactor oa object to better manage resources Lionel Landwerlin
2019-05-14 18:14   ` Umesh Nerlige Ramappa
2019-05-15  9:11     ` Lionel Landwerlin [this message]
2019-05-15 17:44       ` Umesh Nerlige Ramappa
  -- strict thread matches above, loose matches on Subject: below --
2019-08-06 23:30 Umesh Nerlige Ramappa
2019-08-07 19:39 ` Chris Wilson
2019-08-05 16:53 Umesh Nerlige Ramappa
2019-05-15 18:07 Umesh Nerlige Ramappa
2019-05-16  9:48 ` Lionel Landwerlin
2019-05-01 16:50 Umesh Nerlige Ramappa
2019-05-02 10:26 ` Lionel Landwerlin

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=46f258bd-ac0a-94d2-2acd-9ffdcabbaa85@intel.com \
    --to=lionel.g.landwerlin@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=umesh.nerlige.ramappa@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