All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm/i915: put ring frequency and turbo setup into a work queue v2
Date: Wed, 31 Oct 2012 13:44:27 -0700	[thread overview]
Message-ID: <20121031134427.081aa0ed@jbarnes-desktop> (raw)
In-Reply-To: <CAKMK7uH4hA16AxZoUB4Uqs+Z76bwN2gL8C4yseBT-4vN0JtmAw@mail.gmail.com>

On Tue, 30 Oct 2012 18:17:58 +0100
Daniel Vetter <daniel@ffwll.ch> wrote:

> On Fri, Oct 26, 2012 at 7:08 PM, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> > Communicating via the mailbox registers with the PCU can take quite
> > awhile.  And updating the ring frequency or enabling turbo is not
> > something that needs to happen synchronously, so take it out of our init
> > and resume paths to speed things up (~200ms on my T420).
> >
> > v2: add comment about why we use a work queue (Daniel)
> >     make sure work queue is idle on suspend (Daniel)
> >     use a delayed work queue since there's no hurry (Daniel)
> >
> > References: https://bugs.freedesktop.org/show_bug.cgi?id=54089
> >
> > Signed-of-by: Jesse Barnes <jbarnes@virtuougseek.org>
> 
> Unfortunately I have to tear this patch apart ;-)
> 
> - The cleanup sequence is inconsistent afaict: Check the ordering of
> intel_gt_cleanup vs. intel_disable_gt_powersave

Ok will fix.

> - cancel_*_sync is on a level with *_lock in it's ability to hang
> machines in a deadlock. Hiding it in an innocent sounding functions
> like gt_cleanup (which _only_ cancels the work item) is not a good
> idea. Also, I'd really prefer more symmetric in our setup/teardown
> code, so if that cancel_work can't be in in disable_gt_powersave, we
> need a good reason for it. I know, lock inversion, but my next point
> will solve that ;-)

Note we have timeouts and such in the cancellation path, so I don't
think there's any way it could hang?

> - you still grab the dev->struct_mutex lock, which means you've only
> moved that 200ms delay to someplace you don't measure it. Most likely
> it'll be right when userspace wants to do a nice 15 frames fade-in for
> the unlock screen, which we'll completely drop on the floor due to
> hogging the execbuf lock for an eternity.

Oh it'll probably happen around VT switch time while we do the silly
dance (that's another thing I'd like to remove).

> Iow we need to add a new dev_priv->rps.lock mutex in a first patch,
> then move things around like you do here. That should also take care
> of any deadlock problems with the work item itself, so you can move
> the cancel_work into disable_gt_powersave right before we shut down
> rps/rc6.

Yeah that would be nicer.  There's really no need to block anyone on
the ring freq and RPS stuff; they can happen totally asynchronously (at
least I'm pretty sure of this, we do have bugs that indicate RPS vs RC6
may be an issue we need to handle, but that's neither here nor there).

-- 
Jesse Barnes, Intel Open Source Technology Center

  reply	other threads:[~2012-10-31 20:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-26 17:08 [PATCH 1/3] drm/i915: don't block resume on fb console resume Jesse Barnes
2012-10-26 17:08 ` [PATCH 2/3] drm/i915: put ring frequency and turbo setup into a work queue v2 Jesse Barnes
2012-10-30 16:53   ` Rodrigo Vivi
2012-10-30 16:58     ` Jesse Barnes
2012-10-30 17:03       ` Rodrigo Vivi
2012-10-30 17:09         ` Daniel Vetter
2012-10-30 17:17   ` Daniel Vetter
2012-10-31 20:44     ` Jesse Barnes [this message]
2012-10-26 17:08 ` [PATCH 3/3] drm/i915: don't rewrite the GTT on resume v2 Jesse Barnes
2012-10-28 10:47   ` Chris Wilson
2012-10-30 17:59   ` Daniel Vetter
2012-10-30 21:32     ` Chris Wilson
2012-10-30 21:58       ` Daniel Vetter
2012-10-30 23:25       ` Jesse Barnes
2012-10-30 16:58 ` [PATCH 1/3] drm/i915: don't block resume on fb console resume Rodrigo Vivi

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=20121031134427.081aa0ed@jbarnes-desktop \
    --to=jbarnes@virtuousgeek.org \
    --cc=daniel@ffwll.ch \
    --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.