From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jacob Shin Subject: [PATCH V2 2/2] cpufreq, powernow: enable/disable core performance boost for all CPUs in the Node Date: Thu, 20 Jun 2013 12:04:09 -0500 Message-ID: <1371747849-1817-2-git-send-email-jacob.shin@amd.com> References: <1371747849-1817-1-git-send-email-jacob.shin@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1371747849-1817-1-git-send-email-jacob.shin@amd.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , Liu Jinsong Cc: Jacob Shin , Suravee Suthikulanit , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Since disabling turbo mode on one CPU also affect all other sibling CPUs in the same Node, we need to call update_cpb on all CPUs in the same node. Signed-off-by: Jacob Shin --- xen/arch/x86/acpi/cpufreq/powernow.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/acpi/cpufreq/powernow.c b/xen/arch/x86/acpi/cpufreq/powernow.c index 2c9fea2..3b5507a 100644 --- a/xen/arch/x86/acpi/cpufreq/powernow.c +++ b/xen/arch/x86/acpi/cpufreq/powernow.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -82,10 +83,20 @@ static void update_cpb(void *data) static int powernow_cpufreq_update (int cpuid, struct cpufreq_policy *policy) { - if (!cpumask_test_cpu(cpuid, &cpu_online_map)) - return -EINVAL; - - on_selected_cpus(cpumask_of(cpuid), update_cpb, policy, 1); + unsigned int cpu; + cpumask_t cpus; + + cpumask_and(&cpus, &cpu_online_map, &node_to_cpumask[cpu_to_node[cpuid]]); + on_selected_cpus(&cpus, update_cpb, policy, 1); + + if (!cpumask_equal(policy->cpus, &cpus)) { + ASSERT(cpumask_subset(policy->cpus, &cpus)); + for_each_cpu(cpu, &cpus) { + struct cpufreq_policy *p; + p = per_cpu(cpufreq_cpu_policy, cpu); + p->turbo = policy->turbo; + } + } return 0; } -- 1.7.9.5