Skip to content

Commit

Permalink
cpufreq: intel_pstate: Use CPU load based algorithm for PM_MOBILE
Browse files Browse the repository at this point in the history
Use get_target_pstate_use_cpu_load() to calculate target P-State for
devices, with the preferred power management profile in ACPI FADT
set to PM_MOBILE.

This may help in resolving some thermal issues caused by low sustained
cpu bound workloads. The current algorithm tend to over provision in this
case as it doesn't look at the CPU busyness.

Also included the fix from Arnd Bergmann <arnd@arndb.de> to solve compile
issue, when CONFIG_ACPI is not defined.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Srinivas Pandruvada authored and Rafael J. Wysocki committed Nov 14, 2016
1 parent dcd2ea4 commit 7f7a516
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/cpufreq/intel_pstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,19 @@ static void __init copy_pid_params(struct pstate_adjust_policy *policy)
pid_params.setpoint = policy->setpoint;
}

#ifdef CONFIG_ACPI
static void intel_pstate_use_acpi_profile(void)
{
if (acpi_gbl_FADT.preferred_profile == PM_MOBILE)
pstate_funcs.get_target_pstate =
get_target_pstate_use_cpu_load;
}
#else
static void intel_pstate_use_acpi_profile(void)
{
}
#endif

static void __init copy_cpu_funcs(struct pstate_funcs *funcs)
{
pstate_funcs.get_max = funcs->get_max;
Expand All @@ -1782,6 +1795,7 @@ static void __init copy_cpu_funcs(struct pstate_funcs *funcs)
pstate_funcs.get_vid = funcs->get_vid;
pstate_funcs.get_target_pstate = funcs->get_target_pstate;

intel_pstate_use_acpi_profile();
}

#ifdef CONFIG_ACPI
Expand Down

0 comments on commit 7f7a516

Please sign in to comment.