Skip to content

Commit

Permalink
cpufreq / sched: ignore SMT when determining max cpu capacity
Browse files Browse the repository at this point in the history
PELT does not consider SMT when scaling its utilization values via
arch_scale_cpu_capacity(). The value in rq->cpu_capacity_orig does
take SMT into consideration though and therefore may be smaller than
the utilization reported by PELT.

On an Intel i7-3630QM for example rq->cpu_capacity_orig is 589 but
util_avg scales up to 1024. This means that a 50% utilized CPU will show
up in schedutil as ~86% busy.

Fix this by using the same CPU scaling value in schedutil as that which
is used by PELT.

Signed-off-by: Steve Muckle <smuckle@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Steve Muckle authored and Rafael J. Wysocki committed Aug 31, 2016
1 parent 12bde33 commit 8314bc8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kernel/sched/cpufreq_schedutil.c
Original file line number Diff line number Diff line change
@@ -147,7 +147,9 @@ static unsigned int get_next_freq(struct sugov_cpu *sg_cpu, unsigned long util,
static void sugov_get_util(unsigned long *util, unsigned long *max)
{
struct rq *rq = this_rq();
unsigned long cfs_max = rq->cpu_capacity_orig;
unsigned long cfs_max;

cfs_max = arch_scale_cpu_capacity(NULL, smp_processor_id());

*util = min(rq->cfs.avg.util_avg, cfs_max);
*max = cfs_max;

0 comments on commit 8314bc8

Please sign in to comment.