All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Peter Clifton <pcjc2@cam.ac.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: FPS performance increase when deliberately spinning the CPU with an unrelated task
Date: Mon, 25 Oct 2010 17:26:38 -0700	[thread overview]
Message-ID: <20101025172638.2cde1e35@jbarnes-desktop> (raw)
In-Reply-To: <1288052044.13125.8.camel@pcjc2lap>

On Tue, 26 Oct 2010 01:14:04 +0100
Peter Clifton <pcjc2@cam.ac.uk> wrote:

> On Mon, 2010-10-25 at 13:20 -0700, Jesse Barnes wrote:
> > On Mon, 25 Oct 2010 13:11:24 -0700
> > Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> > 
> > > There are some bits in the GMCH to control memory behavior during CPU
> > > C-states.  Can you dump the 16 bits at MCHBAR address 0xf08?  You
> > > should be able to do that by doing I915_READ16(MCHBAR_MIRROR_BASE +
> > > 0xf08).  Assuming bits 3:2 and 1:0 are nonzero, it may help to set them
> > > all to 0.  That will disable several memory related power saving
> > > features while the CPU is in a deep sleep state.
> > 
> > Oh and bits 5:4 and bit 6 as well.  Bit 6 controls whether memory stays
> > active in C2, and bits 5:4 control which memory shutdown features are
> > enabled in C2; clearing 5:4 will disable shutdown, as will bit 6.
> 
> Is there a document somewhere which describes those? I've downloaded the
> GM45 datasheet, and it lists that address as "reserved".
> 
> FWIW. the answer is 0x730f

Ok so aggressive power saving is enabled for deep sleep states (makes
sense).  Unfortunately these bits aren't documented (even internally
it's hard to find info on this range).

> 
> (I hijacked one of the debugfs functions with this:)
> 
> 	seq_printf(m, "PCJC2 DEBUG HACK MCHBAR_MIRROR_BASE + 0xf08:        %04x\n",
> 		   I915_READ16(MCHBAR_MIRROR_BASE + 0xf08));
> 
> I trust that is correct?
> 
> Converting to bin:
> 
> 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
>  0  1  1  1  0  0  1  1  0  0  0  0  1  1  1  1
> 
>                             ^  ^  ^  ^  ^  ^  ^
>       Should I poke this 1? |  |__|  |__|__|__|
>       Already clear is ok?_____|              |___ Will try these at 0
> 
> 
> Just off the top of your head.. is there any way of poking these from
> userspace without reloading kernel modules?
> 
> 
> Disabling CPU frequency scaling is only half of the story, as it appears
> keeping the CPU out of C4 is the main benefit. I was checking with
> powertop when I was playing before. I don't see C2 on my machine, only
> C0, C1 and C4 (the main resident state when not working).
> 
> I understand C4 is pretty rubbish for memory usage as it disabled bus
> mastering is that what the graphics controller will require? 
> 
> Allegedly:
> 
> Your CPU supports the following C-states : C1 C2 C3 C4 C5 C6 
> Your BIOS reports the following C-states : C1 C4 
> 
> :(
> 
> 
> I'll wait your suggestions based on the above before I try poking the
> register.

You should be able to use intel_reg_write from intel-gpu-tools to poke
in the new values.

If C4 is the real issue, you can limit your c-state by booting with
cpu.max_cstate= (or is it processor.max_cstate=) at startup; that
should affect the behavior of the c-state driver.

-- 
Jesse Barnes, Intel Open Source Technology Center

  reply	other threads:[~2010-10-26  0:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-23 12:02 FPS performance increase when deliberately spinning the CPU with an unrelated task Peter Clifton
2010-10-25 20:11 ` Jesse Barnes
2010-10-25 20:20   ` Jesse Barnes
2010-10-26  0:14     ` Peter Clifton
2010-10-26  0:26       ` Jesse Barnes [this message]
2010-10-25 20:14 ` Eric Anholt
2010-10-26 19:34   ` Peter Clifton

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=20101025172638.2cde1e35@jbarnes-desktop \
    --to=jbarnes@virtuousgeek.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=pcjc2@cam.ac.uk \
    /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.