From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Speed up idle detection by kicking the tasklets
Date: Mon, 07 May 2018 11:54:27 +0300 [thread overview]
Message-ID: <87efinyhfg.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <152568231602.9723.1494572635148146834@mail.alporthouse.com>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> Quoting Mika Kuoppala (2018-05-07 09:34:24)
>> Chris Wilson <chris@chris-wilson.co.uk> writes:
>>
>> > We rely on ksoftirqd to run in a timely fashion in order to drain the
>> > execlists queue. Quite frequently, it does not. In some cases we may see
>> > latencies of over 200ms triggering our idle timeouts and forcing us to
>> > declare the driver wedged!
>> >
>> > Thus we can speed up idle detection by bypassing ksoftirqd in these
>> > cases and flush our tasklet to confirm if we are indeed still waiting
>> > for the ELSP to drain.
>> >
>> > v2: Put the execlists.first check back; it is required for handling
>> > reset!
>> >
>> > References: https://bugs.freedesktop.org/show_bug.cgi?id=106373
>> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> > Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
>> > ---
>> > drivers/gpu/drm/i915/intel_engine_cs.c | 15 ++++++++++++---
>> > 1 file changed, 12 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
>> > index 70325e0824e3..a3111511ea1d 100644
>> > --- a/drivers/gpu/drm/i915/intel_engine_cs.c
>> > +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
>> > @@ -945,10 +945,19 @@ bool intel_engine_is_idle(struct intel_engine_cs *engine)
>> > return true;
>> >
>> > /* Waiting to drain ELSP? */
>> > - if (READ_ONCE(engine->execlists.active))
>> > - return false;
>> > + if (READ_ONCE(engine->execlists.active)) {
>> > + struct intel_engine_execlists *execlists = &engine->execlists;
>> > +
>> > + if (tasklet_trylock(&execlists->tasklet)) {
>>
>> Now that we have the lock, sample active again to catch
>> the late tasklet run and skip running if so?
>
> It becomes a nop in the submission tasklet, it's not dangerous. So it
> comes down to what looks less of a wart!
The nice side effect of this kick is that now the hangcheck also won't
fall a victim.
Should we have a test which adds random and long tasklet delays?
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-05-07 8:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-06 15:15 [PATCH] drm/i915: Speed up idle detection by kicking the tasklets Chris Wilson
2018-05-06 15:55 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-05-06 16:41 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-05-06 17:13 ` [PATCH v2] " Chris Wilson
2018-05-07 8:34 ` Mika Kuoppala
2018-05-07 8:38 ` Chris Wilson
2018-05-07 8:54 ` Mika Kuoppala [this message]
2018-05-07 9:03 ` Chris Wilson
2018-05-06 17:33 ` ✓ Fi.CI.BAT: success for drm/i915: Speed up idle detection by kicking the tasklets (rev2) Patchwork
2018-05-06 18:17 ` ✓ Fi.CI.IGT: " 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=87efinyhfg.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox