mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: David Laight <David.Laight@ACULAB.COM>
Cc: "x86@kernel.org" <x86@kernel.org>, linux-kernel@vger.kernel.org
Subject: Re: Running an Ivy Bridge cpu at fixed frequency
Date: Thu, 5 Dec 2019 10:45:36 +0100	[thread overview]
Message-ID: <20191205094535.GF2810@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <8eeee0695c664305ba6a56bce42a995f@AcuMS.aculab.com>

[-- Attachment #1: Type: text/plain, Size: 1239 bytes --]

On Wed, Dec 04, 2019 at 05:01:32PM +0000, David Laight wrote:
> Is there any way to persuade the intel_pstate driver to make an Ivy bridge (i7-3770)
> cpu run at a fixed frequency?

You can, use performance governor and put scaling_{min,max}_freq at the
base_frequency (I _think_, I never quite remember if that is the max non
turbo P state).

If that doesn't work, simply put it at cpuinfo_min_freq. It's slow, but
it's guaranteed stable.

> It is really difficult to compare code execution times when the cpu clock speed
> keeps changing.

As Andy already wrote, perf is really good for this.

Find attached, it probably is less shiny than what Andy handed you, but
contains all the bits required to frob something.

> I thought I'd managed by setting the 'scaling_max_freq' to 1.7GHz, but even that
> doesn't seem to be working now.

You also have to set the min I think, and select the performance
governor, otherwise it's too tempted to be 'smart' about stuff.

> It would also be nice to run a little faster than that - but without it 'randomly'
> going to 'turbo' frequencies (which it is doing even after I've set no_turbo to 1).
> 
> An alternative would be a variable frequency TSC - might give more consistent values.

perf :-)

[-- Attachment #2: spinlocks.tar.bz2 --]
[-- Type: application/octet-stream, Size: 29012 bytes --]

  parent reply	other threads:[~2019-12-05  9:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04 17:01 David Laight
2019-12-04 17:57 ` Andy Lutomirski
2019-12-05  9:45 ` Peter Zijlstra [this message]
2019-12-05 15:53   ` David Laight
2019-12-05 17:51     ` Andy Lutomirski
2019-12-06 10:15     ` Peter Zijlstra
2019-12-06 13:06       ` David Laight
2019-12-06 14:47 ` Alexey Klimov

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=20191205094535.GF2810@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=David.Laight@ACULAB.COM \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.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

all inboxes | Powered by JetHome®