Skip to content

Commit

Permalink
sched: Feature to disable APERF/MPERF cpu_power
Browse files Browse the repository at this point in the history
I suspect a feed-back loop between cpuidle and the aperf/mperf
cpu_power bits, where when we have idle C-states lower the ratio,
which leads to lower cpu_power and then less load, which generates
more idle time, etc..

Put in a knob to disable it.

Signed-off-by: Peter Zijlstra <[email protected]>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Sep 15, 2009
1 parent 47fe38f commit 8e6598a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
12 changes: 10 additions & 2 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -3602,11 +3602,19 @@ static void update_cpu_power(struct sched_domain *sd, int cpu)
unsigned long power = SCHED_LOAD_SCALE;
struct sched_group *sdg = sd->groups;

power *= arch_scale_freq_power(sd, cpu);
if (sched_feat(ARCH_POWER))
power *= arch_scale_freq_power(sd, cpu);
else
power *= default_scale_freq_power(sd, cpu);

power >>= SCHED_LOAD_SHIFT;

if ((sd->flags & SD_SHARE_CPUPOWER) && weight > 1) {
power *= arch_scale_smt_power(sd, cpu);
if (sched_feat(ARCH_POWER))
power *= arch_scale_smt_power(sd, cpu);
else
power *= default_scale_smt_power(sd, cpu);

power >>= SCHED_LOAD_SHIFT;
}

Expand Down
5 changes: 5 additions & 0 deletions kernel/sched_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ SCHED_FEAT(LAST_BUDDY, 1)
*/
SCHED_FEAT(CACHE_HOT_BUDDY, 1)

/*
* Use arch dependent cpu power functions
*/
SCHED_FEAT(ARCH_POWER, 0)

SCHED_FEAT(HRTICK, 0)
SCHED_FEAT(DOUBLE_TICK, 0)
SCHED_FEAT(LB_BIAS, 1)
Expand Down

0 comments on commit 8e6598a

Please sign in to comment.