[Intel-gfx] [PATCH 2/2] drm/i915: Use the real cpu max frequency for ring scaling

Chris Wilson chris at chris-wilson.co.uk
Thu Sep 26 02:01:31 CEST 2013


On Wed, Sep 25, 2013 at 04:35:33PM -0700, Ben Widawsky wrote:
> The policy's max frequency is not equal to the CPU's max frequency. The
> ring frequency is derived from the CPU frequency, and not the policy
> frequency.
> 
> One example of how this may differ through sysfs. If the sysfs max
> frequency is modified, that will be used for the max ring frequency
> calculation.
> (/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq). As far as I
> know, no current governor uses anything but max as the default, but in
> theory, they could. Similarly distributions might set policy as part of
> their init process.

Actually this seems to differ based on policy as well. The pstate may
disable turbo mode, in which case policy->max <= policy->cpuinfo.max.
But excluding user intervention, it seems that max is what we want, and
it is possibly arguable that we do not want to push the core to turbo
for a GPU bound workload - though I'm not sure if the ring frequency
continues to scale with turbo cpu frequencies.
 
> It's ideal to use the real frequency because when we're currently scaled
> up on the GPU. In this case we likely want to race to idle, and using a
> less than max ring frequency is non-optimal for this situation.

Also note that scaling the cpu frequency cuts into our thermal headroom,
so for ULT devices it may not be clearly beneficial.
 
> AFAIK, this patch should have no impact on a majority of people.

And also obsolete since HSW.
 
> This behavior hasn't been changed since it was first introduced:
> commit 23b2f8bb92feb83127679c53633def32d3108e70
> Author: Jesse Barnes <jbarnes at virtuousgeek.org>
> Date:   Tue Jun 28 13:04:16 2011 -0700
> 
>     drm/i915: load a ring frequency scaling table v3
> 
> CC: Jesse Barnes <jbarnes at virtuousgeek.org>
> Signed-off-by: Ben Widawsky <ben at bwidawsk.net>

FWIW,

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

I think using the real range of the CPU frequency rather than the
adjusted policy maximum is sensible. Just the hw implementation is just
a bit silly and it is not clear exactly what the best policy should be.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list