Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754603AbbHQLPc (ORCPT ); Mon, 17 Aug 2015 07:15:32 -0400 Received: from eu-smtp-delivery-143.mimecast.com ([146.101.78.143]:47032 "EHLO eu-smtp-delivery-143.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750937AbbHQLPa convert rfc822-to-8bit (ORCPT ); Mon, 17 Aug 2015 07:15:30 -0400 Message-ID: <55D1C27C.2030600@arm.com> Date: Mon, 17 Aug 2015 12:16:12 +0100 From: Juri Lelli User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Peter Zijlstra , Morten Rasmussen CC: "mingo@redhat.com" , "vincent.guittot@linaro.org" , "daniel.lezcano@linaro.org" , Dietmar Eggemann , "yuyang.du@intel.com" , "mturquette@baylibre.com" , "rjw@rjwysocki.net" , "sgurrappadi@nvidia.com" , "pang.xunlei@zte.com.cn" , "linux-kernel@vger.kernel.org" , "linux-pm@vger.kernel.org" Subject: Re: [RFCv5 PATCH 45/46] sched/cpufreq_sched: modify pcpu_capacity handling References: <1436293469-25707-1-git-send-email-morten.rasmussen@arm.com> <1436293469-25707-46-git-send-email-morten.rasmussen@arm.com> <20150816203512.GK10304@worktop.programming.kicks-ass.net> In-Reply-To: <20150816203512.GK10304@worktop.programming.kicks-ass.net> X-OriginalArrivalTime: 17 Aug 2015 11:15:27.0248 (UTC) FILETIME=[0507C900:01D0D8DE] X-MC-Unique: -nC5dKo-R9mVM37OAFn8qA-1 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1731 Lines: 50 Hi Peter, On 16/08/15 21:35, Peter Zijlstra wrote: > On Tue, Jul 07, 2015 at 07:24:28PM +0100, Morten Rasmussen wrote: >> From: Juri Lelli >> >> Use the cpu argument of cpufreq_sched_set_cap() to handle per_cpu writes, >> as the thing can be called remotely (e.g., from load balacing code). >> >> cc: Ingo Molnar >> cc: Peter Zijlstra >> >> Signed-off-by: Juri Lelli >> --- >> kernel/sched/cpufreq_sched.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/kernel/sched/cpufreq_sched.c b/kernel/sched/cpufreq_sched.c >> index 06ff183..b81ac779 100644 >> --- a/kernel/sched/cpufreq_sched.c >> +++ b/kernel/sched/cpufreq_sched.c >> @@ -151,7 +151,7 @@ void cpufreq_sched_set_cap(int cpu, unsigned long capacity) >> unsigned long capacity_max = 0; >> >> /* update per-cpu capacity request */ >> - __this_cpu_write(pcpu_capacity, capacity); >> + per_cpu(pcpu_capacity, cpu) = capacity; >> >> policy = cpufreq_cpu_get(cpu); >> if (IS_ERR_OR_NULL(policy)) { > > Uhm,.. this function seems to hard assume its called for the local CPU. > It will only use the irq_queue_work_on() if the cpufreq thing requires > the thread, otherwise it will call the method directly on the calling > cpu. > True, but we still retrieve policy from cpu passed as argument; and then we use policy to request a freq transition, that should end up updating the right cpu. Thanks, - Juri -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/