All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/i915: Provide a timeout to i915_gem_wait_for_idle()
Date: Mon, 09 Jul 2018 14:52:51 +0300	[thread overview]
Message-ID: <87k1q4tylo.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <153113686319.18500.5129085870694799690@cwilso3-mobl.ger.corp.intel.com>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Quoting Mika Kuoppala (2018-07-09 12:38:10)
>> Chris Wilson <chris@chris-wilson.co.uk> writes:
>> > -int i915_gem_wait_for_idle(struct drm_i915_private *i915, unsigned int flags)
>> > +int i915_gem_wait_for_idle(struct drm_i915_private *i915,
>> > +                        unsigned int flags, long timeout)
>> >  {
>> >       GEM_TRACE("flags=%x (%s)\n",
>> >                 flags, flags & I915_WAIT_LOCKED ? "locked" : "unlocked");
>> 
>> Did you omit enhancing the trace on purpose?
>
> Didn't even consider it. I personally only use it as a breadcrumb in the
> trace.
>  
>> Eventually i915_request_wait will assert for silly timeout values, but
>> should we add assertion here too as wait_for_timeline will
>> return what we put, for nonactive timelines?
>> 
>> > @@ -3798,9 +3801,9 @@ int i915_gem_wait_for_idle(struct drm_i915_private *i915, unsigned int flags)
>> >               lockdep_assert_held(&i915->drm.struct_mutex);
>> >  
>> >               list_for_each_entry(tl, &i915->gt.timelines, link) {
>> > -                     err = wait_for_timeline(tl, flags);
>> > -                     if (err)
>> > -                             return err;
>> > +                     timeout = wait_for_timeline(tl, flags, timeout);
>> > +                     if (timeout < 0)
>> > +                             return timeout;
>> >               }
>> >  
>> >               err = wait_for_engines(i915);
>> 
>> To truely serve the caller, the remaining timeout could be passed to
>> wait_for_engines too, but that can be followup.
>
> I don't think so. The timeout we employ there is specific to the CSB
> delay and we need to employ that irrespective of the caller timeout.
> At this point, we have successfully waited for all requests, and now
> just have to drain any HW queues -- imo, we have completed the task the
> caller set out for us (requests completed within the timeout). And now
> onto the followup retirement optimisations.

Agreed, my mistake. At that point all the requests are already done.
If the engine hw flush timeouts, that is catastrophic, regardless
of caller preferences.

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

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

  reply	other threads:[~2018-07-09 11:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-09 10:42 [PATCH 1/3] drm/i915: Provide a timeout to i915_gem_wait_for_idle() Chris Wilson
2018-07-09 10:42 ` [PATCH 2/3] drm/i915: Provide a timeout to i915_gem_wait_for_idle() on setup Chris Wilson
2018-07-09 12:01   ` Mika Kuoppala
2018-07-09 10:42 ` [PATCH 3/3] drm/i915/selftests: Replace wait-on-timeout with explicit timeout Chris Wilson
2018-07-09 12:07   ` Mika Kuoppala
2018-07-09 11:18 ` ✓ Fi.CI.BAT: success for series starting with [1/3] drm/i915: Provide a timeout to i915_gem_wait_for_idle() Patchwork
2018-07-09 11:38 ` [PATCH 1/3] " Mika Kuoppala
2018-07-09 11:47   ` Chris Wilson
2018-07-09 11:52     ` Mika Kuoppala [this message]
2018-07-09 13:06       ` Chris Wilson
2018-07-09 13:54 ` ✓ Fi.CI.IGT: success for series starting with [1/3] " Patchwork

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=87k1q4tylo.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.