From patchwork Thu Mar 9 11:45:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 95109 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp318780qgd; Thu, 9 Mar 2017 03:45:59 -0800 (PST) X-Received: by 10.99.105.66 with SMTP id e63mr13338698pgc.104.1489059959648; Thu, 09 Mar 2017 03:45:59 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1si6219661pgc.376.2017.03.09.03.45.59; Thu, 09 Mar 2017 03:45:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932256AbdCILp5 (ORCPT + 13 others); Thu, 9 Mar 2017 06:45:57 -0500 Received: from mail-pg0-f51.google.com ([74.125.83.51]:36390 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932217AbdCILp4 (ORCPT ); Thu, 9 Mar 2017 06:45:56 -0500 Received: by mail-pg0-f51.google.com with SMTP id g2so8331730pge.3 for ; Thu, 09 Mar 2017 03:45:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=UbyNVwd+Z7X+ocUCTxvMP0FDiq/RwfawYbAXol3Y5CI=; b=Piwp9oKZ3CJy+/WOJMM8yTyA4Qf1/7cB0O+qLd8T+4GuFr8lnSrZhFazHVUrAdIK65 HXmgOI6RyuWKRYRmbEFlS/fwaxd9k7HejFs2zOMwTsN5a3HSO7Ms2JC6qgNVHEf2mRah QrysC3hYtToXqG7DyOfgRIXPE0UZe1KH50LrA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=UbyNVwd+Z7X+ocUCTxvMP0FDiq/RwfawYbAXol3Y5CI=; b=U+yC2JbSlmah8aJ0BZ8jBKECJTUcFj4t2Z7vOSbQdNE0TF2R/45rKTjeYy1L7KOADU peJuXrk72xS0Bsk1zFKzsLtzlc3KbwKaWn4vADBzJlIF8ymqk6r3DLX65R0ArzAgJkUE CCm2IsEx9BPGyHy3/Lz6I29ReHQg1kvQ6OYP3aJxRFOKpOk+vq6kdujoFaUin8fzp7tz k6XQ4LGyCfhzI8r98R2NggYWcDcfiHcn6T+/irOwoUM60heXziObPq0YPfI+X5Cs6BlM nW4xMtERTqCbVjXf8L2AysUGbBWDm7yaSnPnLmP/SuxetYDYXGRRWWxLNC2Fa17XxVW4 UwsA== X-Gm-Message-State: AMke39mjjaRW182ZSOAvoafN0hBhFwK5lIpTZzYG4zehU1tIruRjqjtm6p7hO5y2HpDfTFw3 X-Received: by 10.84.174.131 with SMTP id r3mr16592943plb.30.1489059954790; Thu, 09 Mar 2017 03:45:54 -0800 (PST) Received: from localhost ([122.171.239.200]) by smtp.gmail.com with ESMTPSA id 78sm12051482pfm.122.2017.03.09.03.45.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Mar 2017 03:45:54 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , Ingo Molnar , Peter Zijlstra Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot , smuckle.linux@gmail.com, juri.lelli@arm.com, Morten.Rasmussen@arm.com, patrick.bellasi@arm.com, eas-dev@lists.linaro.org, Viresh Kumar Subject: [RFC 5/9] sched: cpufreq: remove smp_processor_id() in remote paths Date: Thu, 9 Mar 2017 17:15:15 +0530 Message-Id: <834d098efe029ee687bac7690bb482e9263a766b.1489058244.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.7.1.410.g6faf27b In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Steve Muckle Upcoming support for remote callbacks from the scheduler into schedutil requires that the CPU identified in the hook structure be used to indicate the CPU being operated on, rather than relying on smp_processor_id(). Note that policy->cpu is passed to trace_cpu_frequency() in fast switch path, as it is safe to use any CPU which is managed by the current policy. Signed-off-by: Steve Muckle [ vk: updated commit log, minor code cleanups and use policy->cpu for traces ] Signed-off-by: Viresh Kumar --- kernel/sched/cpufreq_schedutil.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.7.1.410.g6faf27b diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index a418544c51b1..b168c31f1c8f 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -96,7 +96,7 @@ static void sugov_fast_switch(struct cpufreq_policy *policy, return; policy->cur = next_freq; - trace_cpu_frequency(next_freq, smp_processor_id()); + trace_cpu_frequency(next_freq, policy->cpu); } static void sugov_update_commit(struct sugov_policy *sg_policy, u64 time, @@ -106,7 +106,7 @@ static void sugov_update_commit(struct sugov_policy *sg_policy, u64 time, if (policy->fast_switch_enabled) { if (sg_policy->next_freq == next_freq) { - trace_cpu_frequency(policy->cur, smp_processor_id()); + trace_cpu_frequency(policy->cur, policy->cpu); return; } sg_policy->next_freq = next_freq; @@ -157,12 +157,12 @@ static unsigned int get_next_freq(struct sugov_policy *sg_policy, return cpufreq_driver_resolve_freq(policy, freq); } -static void sugov_get_util(unsigned long *util, unsigned long *max) +static void sugov_get_util(unsigned long *util, unsigned long *max, int cpu) { - struct rq *rq = this_rq(); + struct rq *rq = cpu_rq(cpu); unsigned long cfs_max; - cfs_max = arch_scale_cpu_capacity(NULL, smp_processor_id()); + cfs_max = arch_scale_cpu_capacity(NULL, cpu); *util = min(rq->cfs.avg.util_avg, cfs_max); *max = cfs_max; @@ -216,7 +216,7 @@ static void sugov_update_single(struct update_util_data *hook, u64 time, if (flags & SCHED_CPUFREQ_RT_DL) { next_f = policy->cpuinfo.max_freq; } else { - sugov_get_util(&util, &max); + sugov_get_util(&util, &max, hook->cpu); sugov_iowait_boost(sg_cpu, &util, &max); next_f = get_next_freq(sg_policy, util, max); } @@ -272,7 +272,7 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time, unsigned long util, max; unsigned int next_f; - sugov_get_util(&util, &max); + sugov_get_util(&util, &max, hook->cpu); raw_spin_lock(&sg_policy->update_lock); From patchwork Thu Mar 9 11:45:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 95114 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp319030qgd; Thu, 9 Mar 2017 03:46:41 -0800 (PST) X-Received: by 10.84.198.164 with SMTP id p33mr16768283pld.127.1489060001467; Thu, 09 Mar 2017 03:46:41 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y2si6238978pgy.46.2017.03.09.03.46.41; Thu, 09 Mar 2017 03:46:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932074AbdCILqk (ORCPT + 13 others); Thu, 9 Mar 2017 06:46:40 -0500 Received: from mail-pg0-f44.google.com ([74.125.83.44]:35344 "EHLO mail-pg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932283AbdCILqC (ORCPT ); Thu, 9 Mar 2017 06:46:02 -0500 Received: by mail-pg0-f44.google.com with SMTP id b129so25706578pgc.2 for ; Thu, 09 Mar 2017 03:46:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=3T2DxxEAaMnUpBx6/tgS5n6JCLnzS5FBEyTLgMzUD3I=; b=YKV26Bq+TdfBV2VFwQg2u3ZHmUfzoSTPjVq/xu3uXEx/GWFALjjTYbZnEJ9CAHrqbC 5tz0A6foV+9NoesMik/aJsG0H+Xuw4o69A5CCTZsMWXoQkJF4/RdAMeQxyFm46arkLul KBVNoje3TliRO67xHvSbn281CQar9ZvKdjMVU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=3T2DxxEAaMnUpBx6/tgS5n6JCLnzS5FBEyTLgMzUD3I=; b=tAGRf0o0oDkUrUP12htidcUnsrxAueDZ2OW783Bo0boskpLc6Jhhen/sDdyf12eIfH 4mZsYkY/cXHHq1GwbGJHkJ1UaY3hXOybrQZGOG3E/9neaZv0Z7OwQnFAdWKSndQCynjb Ox2Wi2cxXYFPJEtkxb3SpBgpUP+ROjtOZ2jkhXtz++NAOYzT8oNbMsSBC5gkRP+F3aHJ D5HATAJTh/2H6ZZADUkvZXGT0tQ+FvArE+yGtZfdxzhVKfAMOqQ8NNyoV7ISOdAGuopJ eBUfb7UigJ5DaoOtuiisdp1H0JOEho353BU1hPOn9oubw7drNn7tqM/F2peQxkaVAP2Z 65Vw== X-Gm-Message-State: AMke39k8LCHMUbStS6Ihu7x2BCSU0Gls/Cl+bjU257/KjKtSSHTx6uKkVxpa78Vvrga2KuKI X-Received: by 10.84.196.164 with SMTP id l33mr16870865pld.0.1489059961065; Thu, 09 Mar 2017 03:46:01 -0800 (PST) Received: from localhost ([122.171.239.200]) by smtp.gmail.com with ESMTPSA id 132sm12167568pgf.27.2017.03.09.03.46.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Mar 2017 03:46:00 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , Ingo Molnar , Peter Zijlstra , Viresh Kumar Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot , smuckle.linux@gmail.com, juri.lelli@arm.com, Morten.Rasmussen@arm.com, patrick.bellasi@arm.com, eas-dev@lists.linaro.org Subject: [RFC 7/9] cpufreq: governor: support scheduler cpufreq callbacks on remote CPUs Date: Thu, 9 Mar 2017 17:15:17 +0530 Message-Id: <49216ebaad6b26a1d5916350d07654181662b15b.1489058244.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.7.1.410.g6faf27b In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Steve Muckle In preparation for the scheduler cpufreq callback happening on remote CPUs, add support for this in the legacy (ondemand and conservative) governors. The legacy governors make assumptions about the callback occurring on the CPU being updated. Signed-off-by: Steve Muckle [ vk: minor updates in commit log ] Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq_governor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.1.410.g6faf27b diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c index 47e24b5384b3..c9e786e7ee1f 100644 --- a/drivers/cpufreq/cpufreq_governor.c +++ b/drivers/cpufreq/cpufreq_governor.c @@ -315,7 +315,7 @@ static void dbs_update_util_handler(struct update_util_data *data, u64 time, policy_dbs->last_sample_time = time; policy_dbs->work_in_progress = true; - irq_work_queue(&policy_dbs->irq_work); + irq_work_queue_on(&policy_dbs->irq_work, data->cpu); } static void gov_set_update_util(struct policy_dbs_info *policy_dbs, From patchwork Thu Mar 9 11:45:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 95112 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp318893qgd; Thu, 9 Mar 2017 03:46:19 -0800 (PST) X-Received: by 10.84.133.193 with SMTP id f59mr16660222plf.64.1489059978944; Thu, 09 Mar 2017 03:46:18 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h71si6247740pfj.139.2017.03.09.03.46.18; Thu, 09 Mar 2017 03:46:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932298AbdCILqH (ORCPT + 13 others); Thu, 9 Mar 2017 06:46:07 -0500 Received: from mail-pg0-f52.google.com ([74.125.83.52]:34420 "EHLO mail-pg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932299AbdCILqF (ORCPT ); Thu, 9 Mar 2017 06:46:05 -0500 Received: by mail-pg0-f52.google.com with SMTP id 77so25636370pgc.1 for ; Thu, 09 Mar 2017 03:46:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=E2JnNiU/ziBoafIEzAz45JYOXAZL/fjsOX/5uP1aWO0=; b=GZ9027mWGUXzKeb54UF+uYmuBX8hxsY/Gvoa8XnDUK8+nc+a6sVScZS/xBN11uo3Ra 9akwEjoTSgo9yQLL9z1aIrvozZ31Xbmlj/JgSuhA5Xqln1fEeC+jZw+2j0iEm9SZ4D4M UdnFQY/SOoo6iaXSN9fKsO+kojwkBTtc+/IDQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=E2JnNiU/ziBoafIEzAz45JYOXAZL/fjsOX/5uP1aWO0=; b=Bx7a6wpoGT0jnyCXBBzkBX2HM/BXwNSluNwiO4xcxTfkfbkThrM3vdf7ADg1dbYVnx +60TUU34oo3edGZ9rtjatLt30ebLDjSNHnBVB8UJXQnuAXoeztemBv1KJ8iNfMAXaxGr v6DCNzewANAvnq/31l9f2H7YObRGrlStqCzW5Wr5TjxihOODJeEBPal6HJDk4YmSSQ6s LXZt513mn6/VvllF8NfvWkjRgh7j+0S+BWN8uhBXkCJYWzwTHgsdREHv7P9KFi9TJ3S9 +punz4nnMTsomDquAdGqGIY9fNF37h9fqOm8aFwhugulsDhsBexGBqpjh+coGJw53zlp 2kYQ== X-Gm-Message-State: AMke39lZFQIi/Et7lcV9iPaaW0wtXZekNfqFk1XbXAzZyNJwk2dABxwKrM/dryTz0a+weJIk X-Received: by 10.98.26.199 with SMTP id a190mr13394274pfa.63.1489059964150; Thu, 09 Mar 2017 03:46:04 -0800 (PST) Received: from localhost ([122.171.239.200]) by smtp.gmail.com with ESMTPSA id k76sm12105791pfg.42.2017.03.09.03.46.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Mar 2017 03:46:03 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , Ingo Molnar , Peter Zijlstra , Srinivas Pandruvada , Len Brown , Viresh Kumar Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot , smuckle.linux@gmail.com, juri.lelli@arm.com, Morten.Rasmussen@arm.com, patrick.bellasi@arm.com, eas-dev@lists.linaro.org Subject: [RFC 8/9] intel_pstate: ignore scheduler cpufreq callbacks on remote CPUs Date: Thu, 9 Mar 2017 17:15:18 +0530 Message-Id: X-Mailer: git-send-email 2.7.1.410.g6faf27b In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Steve Muckle In preparation for the scheduler cpufreq callback happening on remote CPUs, check for this case in intel_pstate which currently requires the callback run on the local CPU. Such callbacks are ignored for now. Signed-off-by: Steve Muckle Signed-off-by: Viresh Kumar --- drivers/cpufreq/intel_pstate.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.7.1.410.g6faf27b diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 3d37219a0dd7..bd60f1cd7ea6 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -1930,6 +1930,9 @@ static void intel_pstate_update_util(struct update_util_data *data, u64 time, struct cpudata *cpu = container_of(data, struct cpudata, update_util); u64 delta_ns; + if (smp_processor_id() != data->cpu) + return; + if (pstate_funcs.get_target_pstate == get_target_pstate_use_cpu_load) { if (flags & SCHED_CPUFREQ_IOWAIT) { cpu->iowait_boost = int_tofp(1); From patchwork Thu Mar 9 11:45:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 95113 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp318901qgd; Thu, 9 Mar 2017 03:46:19 -0800 (PST) X-Received: by 10.84.208.102 with SMTP id f35mr16776398plh.19.1489059979680; Thu, 09 Mar 2017 03:46:19 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h71si6247740pfj.139.2017.03.09.03.46.19; Thu, 09 Mar 2017 03:46:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932258AbdCILqR (ORCPT + 13 others); Thu, 9 Mar 2017 06:46:17 -0500 Received: from mail-pg0-f52.google.com ([74.125.83.52]:34431 "EHLO mail-pg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932319AbdCILqN (ORCPT ); Thu, 9 Mar 2017 06:46:13 -0500 Received: by mail-pg0-f52.google.com with SMTP id 77so25636906pgc.1 for ; Thu, 09 Mar 2017 03:46:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=eyKUAP4yyOi+LO/YGRXc7QxqdF+1/ok+1sNn6WFHouc=; b=BFuU71TOxuX0Ue26k+ss7AnXbZ09qCHJIJkyGmlO6tEsdJgFGhtclLVcCy4UR0SqTn O0BxPqxb9TG+go98OGRi2/6gKLw4lWrlCad+KwcoiR7sbSXo6uhzSTbDZsoULuEWTH4l AiwvaJ5r6VEiZO6RwJhW6+5zd2uCIG0Lvx83k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=eyKUAP4yyOi+LO/YGRXc7QxqdF+1/ok+1sNn6WFHouc=; b=XsALv4kZYmNPWVh1tA8zI/f+KYV4ij7MN5Jplnic7wdiXWiDEv/S8GoFNq63u4h52P Vfx3WnvcxXszja4uNq6oLUr6uY2Yf5UNo66dG/870hUHQCo7gg2dnkkBvtgqrdLeEh9C AmulVaH1oKTbo1jIC+iX3FOTc2+o8swJd57HgkY4tDi16c2gqsdADrh5L69qZ5S+DXk5 Oea2rMRVbHz2a+b4meZbCuGzwBDRSdfy8iL06CfYT3XmbfqQ8W9pHUcn226tlKSC+b4m +3cJ6LGz06KBQ56WSX8ppdphntlk+gz9Vr4DEwz3XdiT6d9leZxDmh9O+McJksmZxnwR Lr0Q== X-Gm-Message-State: AMke39kXe47MB+pxjz0fTWbnoJCMjOYPwD90q/RhvPZnnS3BHrIH/EdbaW1ckF4Vkbf78cdM X-Received: by 10.99.123.1 with SMTP id w1mr13431561pgc.118.1489059967339; Thu, 09 Mar 2017 03:46:07 -0800 (PST) Received: from localhost ([122.171.239.200]) by smtp.gmail.com with ESMTPSA id 80sm12102975pfn.61.2017.03.09.03.46.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Mar 2017 03:46:06 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , Ingo Molnar , Peter Zijlstra Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot , smuckle.linux@gmail.com, juri.lelli@arm.com, Morten.Rasmussen@arm.com, patrick.bellasi@arm.com, eas-dev@lists.linaro.org, Viresh Kumar Subject: [RFC 9/9] sched: cpufreq: enable remote sched cpufreq callbacks Date: Thu, 9 Mar 2017 17:15:19 +0530 Message-Id: X-Mailer: git-send-email 2.7.1.410.g6faf27b In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Steve Muckle Now that all clients properly support (or ignore) remote scheduler cpufreq callbacks, remove the restriction that such callbacks only be made in CFS on the local CPU. Signed-off-by: Steve Muckle Signed-off-by: Viresh Kumar --- kernel/sched/fair.c | 6 ++++-- kernel/sched/sched.h | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) -- 2.7.1.410.g6faf27b diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 3e88b35ac157..12db77814814 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3188,7 +3188,9 @@ static inline void set_tg_cfs_propagate(struct cfs_rq *cfs_rq) {} static inline void cfs_rq_util_change(struct cfs_rq *cfs_rq) { - if (&this_rq()->cfs == cfs_rq) { + struct rq *rq = rq_of(cfs_rq); + + if (&rq->cfs == cfs_rq) { /* * There are a few boundary cases this might miss but it should * get called often enough that that should (hopefully) not be @@ -3205,7 +3207,7 @@ static inline void cfs_rq_util_change(struct cfs_rq *cfs_rq) * * See cpu_util(). */ - cpufreq_update_util(rq_of(cfs_rq), 0); + cpufreq_update_util(rq, 0); } } diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 5cbf92214ad8..30c71fc3e02e 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1921,7 +1921,8 @@ static inline void cpufreq_update_util(struct rq *rq, unsigned int flags) { struct update_util_data *data; - data = rcu_dereference_sched(*this_cpu_ptr(&cpufreq_update_util_data)); + data = rcu_dereference_sched(*per_cpu_ptr(&cpufreq_update_util_data, + cpu_of(rq))); if (data) data->func(data, rq_clock(rq), flags); }