From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Andrew Lutomirski <luto@mit.edu>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [TERRIBLE PATCH] Re: [regression?] i915 generating wakeups even when idle
Date: Thu, 9 Dec 2010 10:23:34 -0800 [thread overview]
Message-ID: <20101209102334.3ad97b14@jbarnes-desktop> (raw)
In-Reply-To: <AANLkTinQd6raf4VR9mXEQrB7bFvUT0f5tCKAkwb43QTz@mail.gmail.com>
On Thu, 9 Dec 2010 12:47:52 -0500
Andrew Lutomirski <luto@mit.edu> wrote:
> On Thu, Dec 9, 2010 at 12:20 PM, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> > On Wed, 8 Dec 2010 13:33:20 -0500
> > Andrew Lutomirski <luto@mit.edu> wrote:
> >
> >> On Wed, Dec 8, 2010 at 1:17 PM, Andrew Lutomirski <luto@mit.edu> wrote:
> >> > On Tue, Dec 7, 2010 at 5:13 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> >> >> On Tue, 7 Dec 2010 16:31:24 -0500, Andrew Lutomirski <luto@mit.edu> wrote:
> >> >>> On Tue, Dec 7, 2010 at 4:03 PM, Andrew Lutomirski <luto@mit.edu> wrote:
> >> >>> > Hi all-
> >> >>> >
> >> >>> > Somewhere between Fedora 13 (with 2.6.35, I think) and Fedora 14 +
> >> >>> > 2.6.36.1, i915 started generating exactly 50 interrupts per second
> >> >>> > (suspiciously equal to my refresh rate) when X is running. I have the
> >> >>> > Xorg driver 2.12.0 (specifically
> >> >>> > xorg-x11-drv-intel-2.12.0-6.fc14.1.x86_64). When I switch to a text
> >> >>> > console but leave X running, the interrupts stop.
> >> >>> >
> >> >>> > Any ideas what to look at?
> >> >>>
> >> >>> Quitting compiz fixes it. Suspending compiz also fixes it.
> >> >>
> >> >> So it is the vblank interrupt. The vblank interrupt is get alive for a few
> >> >> seconds after the last use. If it keeps going, then either the system is
> >> >> as idle as you believe or we lost track of the last user and forget to
> >> >> switch off the interrupt.
> >> >>
> >> >> drm.debug=0xf (echo 0xf > /sys/module/drm/parameters/debug) will have the
> >> >> gory details of who/when triggers the vblank interrupt.
> >> >> -Chris
> >> >
> >> > It's the seconds on the clock. That causes activity once per second,
> >> > which looks like this:
> >> >
> >>
> >> [...]
> >>
> >> >
> >> > Maybe that "several seconds" (5, according to the source) timer is way
> >> > too long. Is there any reason that drm_vblank_put doesn't turn off
> >> > interrupts immediately (or, at the latest, on the very next vblank
> >> > interrupt)? After all, preventing deep sleep whenever there is
> >> > display activity every five seconds seems like a waste of power.
> >>
> >> This patch fixes it. It's obviously not ready for prime time, but if
> >> you're OK with the idea I can fix it up and submit it.
> >>
> >> Signed-off-by: Andy Lutomirski <luto@mit.edu>
> >>
> >> Diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> >> index 9d3a503..49eca3f 100644
> >> --- a/drivers/gpu/drm/drm_irq.c
> >> +++ b/drivers/gpu/drm/drm_irq.c
> >> @@ -471,7 +471,7 @@ void drm_vblank_put(struct drm_device *dev, int crtc)
> >>
> >> /* Last user schedules interrupt disable */
> >> if (atomic_dec_and_test(&dev->vblank_refcount[crtc]))
> >> - mod_timer(&dev->vblank_disable_timer, jiffies + 5*DRM_HZ);
> >> + mod_timer(&dev->vblank_disable_timer, jiffies);
> >> }
> >> EXPORT_SYMBOL(drm_vblank_put);
> >
> > This will just move the problem around a bit; 5s is arguably too long
> > to wait before disabling interrupts, but having a second hand or
> > blinking : in your clock is the real issue here. Why don't you disable
> > that instead?
>
> I did.
>
> But I might also scroll a webpage every second or so (or have a
> webpage loaded at some point that updates itself every second) and I
> see no reason to prevent the system from going into its maximum sleep
> state in between updates.
>
> IOW, I think we should optimize for mostly-idle machines in addition
> to completely-idle machines.
It's probably safe to reduce the timeout quite a bit (maybe to 500ms or
so); the idea behind 5s was just to avoid whacking the interrupt
hardware too frequently and to avoid situations where we continually
enable/disable interrupts over a short period of time due to an app
that's only periodically using vblank interrupts.
So it would probably be best to make the 5*DRM_HZ into its own define,
DRM_VBLANK_IDLE_TIMEOUT or similar, and reduce it by a lot, maybe to as
low as a few frames; it could even be dynamic based on the refresh rate.
--
Jesse Barnes, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2010-12-09 18:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-07 21:03 [regression?] i915 generating wakeups even when idle Andrew Lutomirski
2010-12-07 21:31 ` Andrew Lutomirski
2010-12-07 22:12 ` Jesse Barnes
2010-12-07 22:13 ` Chris Wilson
2010-12-07 22:26 ` Andrew Lutomirski
2010-12-08 18:17 ` Andrew Lutomirski
2010-12-08 18:33 ` [TERRIBLE PATCH] " Andrew Lutomirski
2010-12-09 17:20 ` Jesse Barnes
2010-12-09 17:47 ` Andrew Lutomirski
2010-12-09 18:23 ` Jesse Barnes [this message]
2010-12-09 18:32 ` Andrew Lutomirski
2010-12-09 18:44 ` Jesse Barnes
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=20101209102334.3ad97b14@jbarnes-desktop \
--to=jbarnes@virtuousgeek.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=luto@mit.edu \
/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