intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	john.c.harrison@intel.com, daniel.vetter@ffwll.ch,
	Matthew Brost <matthew.brost@intel.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/pmu: Connect engine busyness stats from GuC to pmu
Date: Thu, 7 Oct 2021 08:42:33 -0700	[thread overview]
Message-ID: <20211007154233.GJ4467@unerlige-ril-10.165.21.208> (raw)
In-Reply-To: <ae1570ac-4af1-bb3e-7a97-9b56e2242441@linux.intel.com>

On Thu, Oct 07, 2021 at 09:17:34AM +0100, Tvrtko Ursulin wrote:
>
>On 06/10/2021 21:45, Umesh Nerlige Ramappa wrote:
>>On Wed, Oct 06, 2021 at 10:11:58AM +0100, Tvrtko Ursulin wrote:
>
>[snip]
>
>>>>@@ -762,12 +764,25 @@ submission_disabled(struct intel_guc *guc)
>>>> static void disable_submission(struct intel_guc *guc)
>>>> {
>>>>     struct i915_sched_engine * const sched_engine = guc->sched_engine;
>>>>+    struct intel_gt *gt = guc_to_gt(guc);
>>>>+    struct intel_engine_cs *engine;
>>>>+    enum intel_engine_id id;
>>>>+    unsigned long flags;
>>>>     if (__tasklet_is_enabled(&sched_engine->tasklet)) {
>>>>         GEM_BUG_ON(!guc->ct.enabled);
>>>>         __tasklet_disable_sync_once(&sched_engine->tasklet);
>>>>         sched_engine->tasklet.callback = NULL;
>>>>     }
>>>>+
>>>>+    cancel_delayed_work(&guc->timestamp.work);
>>>
>>>I am not sure when disable_submission gets called so a question - 
>>>could it be important to call cancel_delayed_work_sync here to 
>>>ensure if the worker was running it had exited before proceeding?
>>
>>disable_submission is called in the reset_prepare path for uc 
>>resets. I see this happening only with busy-hang test which does a 
>>global gt reset. The counterpart for this is the 
>>guc_init_engine_stats which is called post reset in the path to 
>>initialize GuC.
>>
>>I tried cancel_delayed_work_sync both here and in park. Seems to 
>>work fine, so will change the calls to _sync versions.
>
>From park is not allowed to sleep so can't do sync from there. It 
>might have been my question which put you on a wrong path, sorry. Now 
>I think question remains what happens if the ping worker happens to be 
>sampling GuC state as GuC is being reset? Do you need some sort of a 
>lock to protect that, or make sure worker skips if reset in progress?
>

If ping ran after the actual gt reset, we should be okay. If it ran 
after we reset prev_total and before gt reset, then we have bad 
busyness. At the same time, skipping ping risks timestamp overflow. I am 
thinking skip ping, but update all stats in the reset_prepare path.  
reset_prepare is running with pm runtime.

On a different note, during reset, we need to store now-start into the 
total_gt_clks also because we may lose that information in the next pmu 
query or ping (post reset). Maybe I will store active_clks instead of 
running in the stats to do that.

Thanks,
Umesh


  reply	other threads:[~2021-10-07 15:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-05 17:47 [Intel-gfx] [PATCH] drm/i915/pmu: Connect engine busyness stats from GuC to pmu Umesh Nerlige Ramappa
2021-10-05 22:14 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/pmu: Connect engine busyness stats from GuC to pmu (rev2) Patchwork
2021-10-05 22:20 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2021-10-05 22:49 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2021-10-05 23:14 ` [Intel-gfx] [PATCH] drm/i915/pmu: Connect engine busyness stats from GuC to pmu Matthew Brost
2021-10-06  8:22   ` Tvrtko Ursulin
2021-10-06 17:04     ` Matthew Brost
2021-10-07 23:00   ` Umesh Nerlige Ramappa
2021-10-06  9:11 ` Tvrtko Ursulin
2021-10-06 20:45   ` Umesh Nerlige Ramappa
2021-10-07  8:17     ` Tvrtko Ursulin
2021-10-07 15:42       ` Umesh Nerlige Ramappa [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-09-24 22:34 Umesh Nerlige Ramappa
2021-10-04 15:21 ` Tvrtko Ursulin
2021-10-05 18:03   ` Umesh Nerlige Ramappa

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=20211007154233.GJ4467@unerlige-ril-10.165.21.208 \
    --to=umesh.nerlige.ramappa@intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=john.c.harrison@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=tvrtko.ursulin@linux.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;
as well as URLs for NNTP newsgroup(s).