From patchwork Thu Jul 27 19:33:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 108861 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2486441qge; Thu, 27 Jul 2017 12:36:00 -0700 (PDT) X-Received: by 10.99.127.21 with SMTP id a21mr4940484pgd.379.1501184159947; Thu, 27 Jul 2017 12:35:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501184159; cv=none; d=google.com; s=arc-20160816; b=AmMAasU0H4IOHA7v+gMZQiUkpfIM3UGfG2GqzJG6o6cU0/wOeJUAn2vr248Y/F6n0S KyzjmAtPMa76NTXZpN1Q65805UTKoxUaWcE+pHQpnsZRjBd84Z05KT4QSYQ+CPAMwOgg Vs/Q0mGhFr6luLdUy5WfGh8e1zJBqM8zOS3OQ1hoO7e+hM+2X58ITrsHRlF9+vpw6ouL NEdGSY+DLyAMJPF4GuBj1kvu0fPAqA6MrB4qU5j9HcdL8KLLFWpmllchoxan5f6EtNR0 krr/EBc+p9RwIhEpOzjMjEEC3nA6yR7W5ne9lcUL3SaccweM4Q0WJU8eOct3NUQqByOR Rt1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=AjespT3PYuaPNWogmq6hRNF8KR5E9iFjsiAy6vqN+ws=; b=QWl9MZWr3dTuxFtztEsPvv6t2OOz3qtDme1+iD6yJ0WQPBBtxHc54mrgX0JHWC2VwM y45zf/quyKhiP2gELhJpPUAYny270+/RL5SV/nn9QRGwRXg/OH/xOhdvgOIaqjWzbuoH lP0Tu2MnJF6xVN6WJPUOGgQMYv7Q00zmZDIHHyosQbNiUJt7KgNd1QWheZYTJTX8mAFl Aowgj53pdrrfnexAT8PLf29DQQWSguL2X4my35hgs9pEJJkFRR7pTcl3JFJY+bclTSjb ffdRscwLPI5tIjcqDmQOJsLNwHfP+ppkebpNar/J5Fex+G00ouJqy9TVHzqBUhkJ6HYk JSAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a68si8119301pli.278.2017.07.27.12.35.59; Thu, 27 Jul 2017 12:35:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751716AbdG0Tdp (ORCPT + 26 others); Thu, 27 Jul 2017 15:33:45 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:51034 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751607AbdG0Tdk (ORCPT ); Thu, 27 Jul 2017 15:33:40 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C716D80D; Thu, 27 Jul 2017 12:33:39 -0700 (PDT) Received: from e107985-lin.cambridge.arm.com (e107985-lin.cambridge.arm.com [10.1.210.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9167C3F540; Thu, 27 Jul 2017 12:33:37 -0700 (PDT) From: Dietmar Eggemann To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org, linux@arm.linux.org.uk, Greg Kroah-Hartman , Russell King , Catalin Marinas , Will Deacon , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v3 01/10] drivers base/arch_topology: free cpumask cpus_to_visit Date: Thu, 27 Jul 2017 20:33:03 +0100 Message-Id: <20170727193312.9849-2-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170727193312.9849-1-dietmar.eggemann@arm.com> References: <20170727193312.9849-1-dietmar.eggemann@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Free cpumask cpus_to_visit in case registering init_cpu_capacity_notifier has failed or the parsing of the cpu capacity-dmips-mhz property is done. The cpumask cpus_to_visit is only used inside the notifier call init_cpu_capacity_callback. Cc: Greg Kroah-Hartman Cc: Juri Lelli Reported-by: Vincent Guittot Signed-off-by: Dietmar Eggemann Acked-by: Vincent Guittot Tested-by: Juri Lelli Reviewed-by: Juri Lelli --- drivers/base/arch_topology.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- 2.11.0 diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index d1c33a85059e..562e0c93ae52 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -206,6 +206,8 @@ static struct notifier_block init_cpu_capacity_notifier = { static int __init register_cpufreq_notifier(void) { + int ret; + /* * on ACPI-based systems we need to use the default cpu capacity * until we have the necessary code to parse the cpu capacity, so @@ -221,8 +223,13 @@ static int __init register_cpufreq_notifier(void) cpumask_copy(cpus_to_visit, cpu_possible_mask); - return cpufreq_register_notifier(&init_cpu_capacity_notifier, - CPUFREQ_POLICY_NOTIFIER); + ret = cpufreq_register_notifier(&init_cpu_capacity_notifier, + CPUFREQ_POLICY_NOTIFIER); + + if (ret) + free_cpumask_var(cpus_to_visit); + + return ret; } core_initcall(register_cpufreq_notifier); @@ -230,6 +237,7 @@ static void parsing_done_workfn(struct work_struct *work) { cpufreq_unregister_notifier(&init_cpu_capacity_notifier, CPUFREQ_POLICY_NOTIFIER); + free_cpumask_var(cpus_to_visit); } #else From patchwork Thu Jul 27 19:33:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 108860 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2486059qge; Thu, 27 Jul 2017 12:35:37 -0700 (PDT) X-Received: by 10.98.59.193 with SMTP id w62mr4979644pfj.335.1501184136952; Thu, 27 Jul 2017 12:35:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501184136; cv=none; d=google.com; s=arc-20160816; b=jubwg4Q+RFjh8Nklj7VMFVAMHLE7Ywd5JGmZmZ37Hp3p0JYRaNwQ/oloaSWPDkx6rN FY56N1Xnm7nOQx2XUW4Z64CeGmOvQcBDI6by0NUZwLgp+oMLQ7skW1KUhyGT5lK/jfsR wrf8R/wJYvFcb7SR6BJjwgVXxwfphFp4KZFUVCpOUMcwNTBq55Pa3nuCol2Y9GSHAglX tAb9Rr4A1Db7aBgByIp39tng1rr41aDzkMWX3fLnxXRWLfPOMfVHmha2O/7oP+3EUv/7 s1qgyJ/4GJfWT2pncq2E4apkMmlHLRvujJsUz3/sOjYEu4X0rdjHt1F6H0Z1AOBmtsea VDYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=YYSEunoAwqDIB5Fm8guZH6DRb0rjRYGm1wWRebB43Eg=; b=zK+vcH7TKOsXvtBE691MssLZ7QR6zZkIvxzr+kmcQW/eUX+TyPA9cGvgyE9eF/zIv3 IxgX+YL/zivCT1tUX1iODt0v/4T+8F/Ff7su83d7MptM+J1cZDCALmvfAqcEKszEtaiY FrEOUHZ5O9w3qfySzULoJ6YuDU1cA7XC4Q36G0CvUPDYCFMRy913WOypR/7zr2CeEvXB 1yNPYoJdAtCARmRSCDfgUVkj7+zcSuvGUyI4qCMzvXzxM+nck/JaPkDlU0XwzhCpQvWn oXzGc7tXI+lQqlyiVMZSpMA1fsR9tp871I+QKfX5nO9b/zFzNCPizfO7Z2RMyhkoNuuv BFrg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n190si11241214pfn.600.2017.07.27.12.35.36; Thu, 27 Jul 2017 12:35:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751754AbdG0Tdq (ORCPT + 26 others); Thu, 27 Jul 2017 15:33:46 -0400 Received: from foss.arm.com ([217.140.101.70]:51062 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751670AbdG0Tdm (ORCPT ); Thu, 27 Jul 2017 15:33:42 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4613615A2; Thu, 27 Jul 2017 12:33:42 -0700 (PDT) Received: from e107985-lin.cambridge.arm.com (e107985-lin.cambridge.arm.com [10.1.210.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0EC423F540; Thu, 27 Jul 2017 12:33:39 -0700 (PDT) From: Dietmar Eggemann To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org, linux@arm.linux.org.uk, Greg Kroah-Hartman , Russell King , Catalin Marinas , Will Deacon , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v3 02/10] cpufreq: provide default frequency-invariance setter function Date: Thu, 27 Jul 2017 20:33:04 +0100 Message-Id: <20170727193312.9849-3-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170727193312.9849-1-dietmar.eggemann@arm.com> References: <20170727193312.9849-1-dietmar.eggemann@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Frequency-invariant accounting support based on the ratio of current frequency and maximum supported frequency is an optional feature an arch can implement. Since there are cpufreq drivers (e.g. cpufreq-dt) which can be build for different arch's a default implementation of the frequency-invariance setter function arch_set_freq_scale() is needed. This default implementation is an empty weak function which will be overwritten by a strong function in case the arch provides one. The setter function passes the cpumask of related (to the frequency change) cpus (online and offline cpus), the (new) current frequency and the maximum supported frequency. Cc: Rafael J. Wysocki Cc: Viresh Kumar Signed-off-by: Dietmar Eggemann --- drivers/cpufreq/cpufreq.c | 11 +++++++++++ include/linux/cpufreq.h | 3 +++ 2 files changed, 14 insertions(+) -- 2.11.0 diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 9bf97a366029..04e2f7e4964e 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2404,6 +2404,17 @@ int cpufreq_boost_enabled(void) EXPORT_SYMBOL_GPL(cpufreq_boost_enabled); /********************************************************************* + * FREQUENCY INVARIANT ACCOUNTING SUPPORT * + *********************************************************************/ + +__weak void arch_set_freq_scale(struct cpumask *cpus, + unsigned long cur_freq, + unsigned long max_freq) +{ +} +EXPORT_SYMBOL_GPL(arch_set_freq_scale); + +/********************************************************************* * REGISTER / UNREGISTER CPUFREQ DRIVER * *********************************************************************/ static enum cpuhp_state hp_online; diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index f10a9b3761cd..e38acc1a4d47 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -899,6 +899,9 @@ static inline bool policy_has_boost_freq(struct cpufreq_policy *policy) extern unsigned int arch_freq_get_on_cpu(int cpu); +extern void arch_set_freq_scale(struct cpumask *cpus, unsigned long cur_freq, + unsigned long max_freq); + /* the following are really really optional */ extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; extern struct freq_attr cpufreq_freq_attr_scaling_boost_freqs; From patchwork Thu Jul 27 19:33:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 108852 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2484251qge; Thu, 27 Jul 2017 12:33:51 -0700 (PDT) X-Received: by 10.84.225.129 with SMTP id u1mr5414710plj.255.1501184031039; Thu, 27 Jul 2017 12:33:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501184031; cv=none; d=google.com; s=arc-20160816; b=FP/Rgudb/bE/RlrtqQqA9sc4y06H+Lphi34paID3S99Apb6ABuCZXSBAmknzIIS1A6 iql8Xa50PUE+zBphZv7a1iOzEfnGRsPyu4yNvQG+fTDy8TGzCRvlLFn0MjeWgl0D9MET j+S6/ri3VeJRo0aIJIXIVImxmPWBgSj48+LXvv20l08WM72NVNbLHrLMQW2Wnc6zYD8+ jkXmV/2yMog1dldc1um1Is6EpyrMevWTTW1b7x79ttYho4nQihKaICKlLKK52RjApe4H 3RKeiSL2BRpes0IzjALWCeDvsdH0/+lc2ihfk1XUzXtJnkIrdQvehN1KfNG8LdvG5nvX L4YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=WOtqZ7YgXlxvWih14PNV+BjDzHmWiG4XRrKJjX73EvA=; b=HUlfA2p2fwHKwobDTTzdLABYUomNKwe8qNM7rIszD0ABnYG40x1KeOPMUQF1ZuwXHZ NcMvp0KzRpWzPWHxUcC5FHH00nlAMlHA4y1LEkCsvEHUDLeJ4jBFkk2yoHP2wnvPnbaV 6WhjfZB6q471BK31hnDmoqi0m9vWO4K04Rlt7bsJgvvna5ei5TFwXFt9erRk/sc2UEkj 9JGUQjervzHrwnG/SVvRvH/b1ixueLZBpdHQV3U6lDYCqS/6/DI1N6HYY3Y+DKuNhFgi g1wLn6dBVaPNDdQY20HBg35KYniYbFWZ0YE0iZF/KSFEwB8HEYKFNk5OVVuVqEZtmqbW mEFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5si12124886pli.880.2017.07.27.12.33.50; Thu, 27 Jul 2017 12:33:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751786AbdG0Tds (ORCPT + 26 others); Thu, 27 Jul 2017 15:33:48 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:51078 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751711AbdG0Tdp (ORCPT ); Thu, 27 Jul 2017 15:33:45 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BB77615BF; Thu, 27 Jul 2017 12:33:44 -0700 (PDT) Received: from e107985-lin.cambridge.arm.com (e107985-lin.cambridge.arm.com [10.1.210.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 82AB33F540; Thu, 27 Jul 2017 12:33:42 -0700 (PDT) From: Dietmar Eggemann To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org, linux@arm.linux.org.uk, Greg Kroah-Hartman , Russell King , Catalin Marinas , Will Deacon , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v3 03/10] cpufreq: arm_big_little: invoke frequency-invariance setter function Date: Thu, 27 Jul 2017 20:33:05 +0100 Message-Id: <20170727193312.9849-4-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170727193312.9849-1-dietmar.eggemann@arm.com> References: <20170727193312.9849-1-dietmar.eggemann@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Call the frequency-invariance setter function arch_set_freq_scale() if the new frequency has been successfully set which is indicated by bL_cpufreq_set_rate() returning 0. Cc: Rafael J. Wysocki Cc: Viresh Kumar Cc: Sudeep Holla Signed-off-by: Dietmar Eggemann --- drivers/cpufreq/arm_big_little.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) -- 2.11.0 Acked-by: Viresh Kumar diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c index ea6d62547b10..8880f8d9d09d 100644 --- a/drivers/cpufreq/arm_big_little.c +++ b/drivers/cpufreq/arm_big_little.c @@ -213,6 +213,7 @@ static int bL_cpufreq_set_target(struct cpufreq_policy *policy, { u32 cpu = policy->cpu, cur_cluster, new_cluster, actual_cluster; unsigned int freqs_new; + int ret; cur_cluster = cpu_to_cluster(cpu); new_cluster = actual_cluster = per_cpu(physical_cluster, cpu); @@ -229,7 +230,14 @@ static int bL_cpufreq_set_target(struct cpufreq_policy *policy, } } - return bL_cpufreq_set_rate(cpu, actual_cluster, new_cluster, freqs_new); + ret = bL_cpufreq_set_rate(cpu, actual_cluster, new_cluster, freqs_new); + + if (!ret) { + arch_set_freq_scale(policy->related_cpus, freqs_new, + policy->cpuinfo.max_freq); + } + + return ret; } static inline u32 get_table_count(struct cpufreq_frequency_table *table) From patchwork Thu Jul 27 19:33:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 108859 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2486025qge; Thu, 27 Jul 2017 12:35:35 -0700 (PDT) X-Received: by 10.98.28.193 with SMTP id c184mr5152842pfc.77.1501184135328; Thu, 27 Jul 2017 12:35:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501184135; cv=none; d=google.com; s=arc-20160816; b=gjzMO3Q1jlFfpweCgUnK8tQuETRrXlm9tWHpxZkZSW3DhTEmzylLIUybQ23/MbBBqo RWpBtts03NTxElpsiBJFkJJ9wAdFRzHdou0BoTP6UMPktVvsxcNYtG5rJkNOQ9tn65gi /SVj5sqOF3/vQTqOvvpYjqY7Ff2INZiDD9sidrArOHBMPYvkUXFFGmTFYSTvVuX12URY BGAbhisg9Nv0Aq2fWpxglx1nC3Xu0WA6Z3I8yYeSuZAnzurMPgKRl8+L/jT0KQspsM/Q O16YnhlOqlRFBSP8MhKUgWg/WS17E84IjBcVrsqTEOL6Qxxmho4rvomgSq1dbf/tDXdu +S3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=2Na+X+ucZpePkIu+UHbbZ+zNpHNjhH9tUuLonkTRAKs=; b=s5HSoLzpBfYV94LWEaGCwc87nZiPQhdbMNWJ2bD5YbC2xNu+3wL/b1P3fIfkVKrZ+/ X5Da7A5yAInJaIxGU4pkJhU3f8UY0IuqHJZw+NYmwhv8Kk1rQ+OHAFqVeCyZBcQIbFpi 4Y756JzhzQXqDxCZU980lYA691xmhawmI5aq9GR+W4DTaonstcz2IcHFoQCiPRoMdIWC 6Xp2dwOJTUvy4s6rTbsP/mM8VyPo3zlonyBdzn+6WgsLN6uZfCAGq+5WnIoPKkAt82nO uFbYksG5JukkYvUC4lmLK2eYIKwUdWu6kEuGo9rZBBgwY8/DnLcL7+JagWmfzSH4AVIN hOSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z4si7375721plh.438.2017.07.27.12.35.23; Thu, 27 Jul 2017 12:35:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751933AbdG0TfV (ORCPT + 26 others); Thu, 27 Jul 2017 15:35:21 -0400 Received: from foss.arm.com ([217.140.101.70]:51094 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751670AbdG0Tdr (ORCPT ); Thu, 27 Jul 2017 15:33:47 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3F5D21610; Thu, 27 Jul 2017 12:33:47 -0700 (PDT) Received: from e107985-lin.cambridge.arm.com (e107985-lin.cambridge.arm.com [10.1.210.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 03E5A3F540; Thu, 27 Jul 2017 12:33:44 -0700 (PDT) From: Dietmar Eggemann To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org, linux@arm.linux.org.uk, Greg Kroah-Hartman , Russell King , Catalin Marinas , Will Deacon , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v3 04/10] cpufreq: dt: invoke frequency-invariance setter function Date: Thu, 27 Jul 2017 20:33:06 +0100 Message-Id: <20170727193312.9849-5-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170727193312.9849-1-dietmar.eggemann@arm.com> References: <20170727193312.9849-1-dietmar.eggemann@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Call the frequency-invariance setter function arch_set_freq_scale() if the new frequency has been successfully set which is indicated by dev_pm_opp_set_rate() returning 0. Cc: Rafael J. Wysocki Cc: Viresh Kumar Signed-off-by: Dietmar Eggemann --- drivers/cpufreq/cpufreq-dt.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- 2.11.0 diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index fef3c2160691..cbac8a7dbc50 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -43,9 +43,17 @@ static struct freq_attr *cpufreq_dt_attr[] = { static int set_target(struct cpufreq_policy *policy, unsigned int index) { struct private_data *priv = policy->driver_data; + unsigned long freq = policy->freq_table[index].frequency; + int ret; + + ret = dev_pm_opp_set_rate(priv->cpu_dev, freq * 1000); - return dev_pm_opp_set_rate(priv->cpu_dev, - policy->freq_table[index].frequency * 1000); + if (!ret) { + arch_set_freq_scale(policy->related_cpus, freq, + policy->cpuinfo.max_freq); + } + + return ret; } /* From patchwork Thu Jul 27 19:33:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 108854 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2484393qge; Thu, 27 Jul 2017 12:34:00 -0700 (PDT) X-Received: by 10.84.217.132 with SMTP id p4mr5393258pli.217.1501184040811; Thu, 27 Jul 2017 12:34:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501184040; cv=none; d=google.com; s=arc-20160816; b=Miaxex72Jp0xZgq0CyXKZsdxa/fMnC7/CkGpg5oprsKKTHgdogqDzEfdYmTroatgAn ihztrWoh0u4VXWBemHpU5qpBfNzDj1469yKmvZnORxlB7jo33Hl7gyTNm1pZy/o3+VNa JcGogp/XmiKV/ho513cedSwBZFcB+47WGJmfOwW7Bl1BRDCEhtVWMy4+8HEk5KMMjuP8 KGI+9ltEEGQ6MSl1uMf+uSVIDhwbtv3/1QhonPOCJMjst+376ldHqGN5v5bsPfrjcViP 6yVDxbB4mTnivEsrBJwNBWukNRImS6RzokN0bTvrw/K8GfB5lWmponBCSkWSzNpWcZ9J SrKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=CY7gSVdYbJh9E9do4Fq4ZVy67fJv/dSDlHhvstk5gpc=; b=KQ4aBHYfKHde7RcovPNQZiMZvgSlztfN9i9dHtaGl/R+juhj0b95j9RjHkM+ha/aRy 54qJNVfypvarj532/DzugobHOpTiYttxhjF+fmb/mu86ArfFV2RwmrfECGG/MWvhgqzJ 3ttltsnrp7Hnc/pwjpfJbYcSpwxtgloVCrG3q5eGe/t02egBTYmOijSxOGjyZcmaYQXc k1/V8zGJC2+y8B956lynXpfalfRd6aqq9cdNADkSc7MtjyUDftXD1SBTwIEOCbSxSiq2 +3394tgs1RCknLstPPGoZwJ/KEyrpH2oLBcYRDfVmvOu1xFi7rqYbG5St9u8E+U+NgU/ 80Vw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z63si3955997plh.986.2017.07.27.12.34.00; Thu, 27 Jul 2017 12:34:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751840AbdG0Td5 (ORCPT + 26 others); Thu, 27 Jul 2017 15:33:57 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:51100 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751788AbdG0Tdu (ORCPT ); Thu, 27 Jul 2017 15:33:50 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B45F0164F; Thu, 27 Jul 2017 12:33:49 -0700 (PDT) Received: from e107985-lin.cambridge.arm.com (e107985-lin.cambridge.arm.com [10.1.210.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7B27F3F540; Thu, 27 Jul 2017 12:33:47 -0700 (PDT) From: Dietmar Eggemann To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org, linux@arm.linux.org.uk, Greg Kroah-Hartman , Russell King , Catalin Marinas , Will Deacon , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v3 05/10] drivers base/arch_topology: provide frequency-invariant accounting support Date: Thu, 27 Jul 2017 20:33:07 +0100 Message-Id: <20170727193312.9849-6-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170727193312.9849-1-dietmar.eggemann@arm.com> References: <20170727193312.9849-1-dietmar.eggemann@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Implements the arch-specific (arm and arm64) frequency-invariance setter function arch_set_freq_scale() which provides the following frequency scaling factor: current_freq(cpu) << SCHED_CAPACITY_SHIFT / max_supported_freq(cpu) One possible consumer of the frequency-invariance getter function topology_get_freq_scale() is the Per-Entity Load Tracking (PELT) mechanism of the task scheduler. Allow inlining of topology_get_freq_scale() into the task scheduler fast path (e.g. __update_load_avg_se()) by coding it as a static inline function in the arch topology header file. Cc: Greg Kroah-Hartman Cc: Juri Lelli Signed-off-by: Dietmar Eggemann --- drivers/base/arch_topology.c | 14 ++++++++++++++ include/linux/arch_topology.h | 10 ++++++++++ 2 files changed, 24 insertions(+) -- 2.11.0 diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index 562e0c93ae52..af9ab98a233e 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -22,6 +22,20 @@ #include #include +DEFINE_PER_CPU(unsigned long, freq_scale) = SCHED_CAPACITY_SCALE; + +void arch_set_freq_scale(struct cpumask *cpus, unsigned long cur_freq, + unsigned long max_freq) +{ + unsigned long scale; + int i; + + scale = (cur_freq << SCHED_CAPACITY_SHIFT) / max_freq; + + for_each_cpu(i, cpus) + per_cpu(freq_scale, i) = scale; +} + static DEFINE_MUTEX(cpu_scale_mutex); static DEFINE_PER_CPU(unsigned long, cpu_scale) = SCHED_CAPACITY_SCALE; diff --git a/include/linux/arch_topology.h b/include/linux/arch_topology.h index 9af3c174c03a..3e3c2657c9a1 100644 --- a/include/linux/arch_topology.h +++ b/include/linux/arch_topology.h @@ -4,6 +4,8 @@ #ifndef _LINUX_ARCH_TOPOLOGY_H_ #define _LINUX_ARCH_TOPOLOGY_H_ +#include + void topology_normalize_cpu_scale(void); struct device_node; @@ -14,4 +16,12 @@ unsigned long topology_get_cpu_scale(struct sched_domain *sd, int cpu); void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity); +DECLARE_PER_CPU(unsigned long, freq_scale); + +static inline +unsigned long topology_get_freq_scale(struct sched_domain *sd, int cpu) +{ + return per_cpu(freq_scale, cpu); +} + #endif /* _LINUX_ARCH_TOPOLOGY_H_ */ From patchwork Thu Jul 27 19:33:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 108858 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2485201qge; Thu, 27 Jul 2017 12:34:54 -0700 (PDT) X-Received: by 10.101.76.3 with SMTP id u3mr4999372pgq.119.1501184094271; Thu, 27 Jul 2017 12:34:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501184094; cv=none; d=google.com; s=arc-20160816; b=y2B47R05gO4dJ5KwmD3XXpcfKg+BDsPaCD5L7gUwk0Sy9/1RXMnWZbxrHczh8Mg7Tm 9TvTEHvrt2FXXpIaeS61L2XKdxKp2HA4v5ylceFzvKzE0ce+HI8eV4BXnSXZVRwX5t5G zsY94uswyoMY2XZ3MAKdoidQw53kaaT1IleXwDoXZAjpxgZD7UeYaKsGjGTZogpcUjyl PxMXf4QnvAb7U8e2ghZxMVejlFy4OZCDftvxaw3+Px04a6g+MdpkEKPBxUm2R4ijo/lh IetxGMsdBGHq0R1NgxRc2I8YK8irR1PhbwTtxFv82j6ean1VwkmtTLvnyZzyjbSNRmYa tKFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Olvg/VktSUwe2XWeKFR75BWzqm9p2BVCeFeksGmvzjQ=; b=NHVkp2BACJ7xY13vkedqnyFsC+rrYVdXjQMRcuMpAMDRIPIiatFjeAchAT+Pq+n/R4 c9Y+nKLGX0yHsdUKDVWcAYVexbyNHXYEQOIsHhx8NpcC7+TrYX+q7iHuEi+G3GVxfuNr HzqjysLWs+c8WOxxLQQvslrbZQSMxP0XHxhOcgC/q7VmPSpwlgMf9MLQ1HIWo8/smohX Pka2NELVZI3MPd1jvUDqkOzfA/oKnoMgNrWX7C0G08QhcP5kk6TSbEtKBD7bSHfIBXpE WExcGdORCsU9/oFG/r/2gV7gOjGXc12AEFtSxTAQJyfgVw4d5lCbuC32bKeLCCkdbA0O 31HA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y10si11432163pgo.679.2017.07.27.12.34.53; Thu, 27 Jul 2017 12:34:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751921AbdG0Tev (ORCPT + 26 others); Thu, 27 Jul 2017 15:34:51 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:51134 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751804AbdG0Tdz (ORCPT ); Thu, 27 Jul 2017 15:33:55 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ABB1E165C; Thu, 27 Jul 2017 12:33:54 -0700 (PDT) Received: from e107985-lin.cambridge.arm.com (e107985-lin.cambridge.arm.com [10.1.210.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7268A3F540; Thu, 27 Jul 2017 12:33:52 -0700 (PDT) From: Dietmar Eggemann To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org, linux@arm.linux.org.uk, Greg Kroah-Hartman , Russell King , Catalin Marinas , Will Deacon , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v3 07/10] arm: wire frequency-invariant accounting support up to the task scheduler Date: Thu, 27 Jul 2017 20:33:09 +0100 Message-Id: <20170727193312.9849-8-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170727193312.9849-1-dietmar.eggemann@arm.com> References: <20170727193312.9849-1-dietmar.eggemann@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit dfbca41f3479 ("sched: Optimize freq invariant accounting") changed the wiring which now has to be done by associating arch_scale_freq_capacity with the actual implementation provided by the architecture. Define arch_scale_freq_capacity to use the arch_topology "driver" function topology_get_freq_scale() for the task scheduler's frequency-invariant accounting instead of the default arch_scale_freq_capacity() in kernel/sched/sched.h. Cc: Russell King Cc: Juri Lelli Signed-off-by: Dietmar Eggemann Acked-by: Vincent Guittot Tested-by: Juri Lelli Reviewed-by: Juri Lelli --- arch/arm/include/asm/topology.h | 5 +++++ 1 file changed, 5 insertions(+) -- 2.11.0 diff --git a/arch/arm/include/asm/topology.h b/arch/arm/include/asm/topology.h index 370f7a732900..a56a9e24f4c0 100644 --- a/arch/arm/include/asm/topology.h +++ b/arch/arm/include/asm/topology.h @@ -24,6 +24,11 @@ void init_cpu_topology(void); void store_cpu_topology(unsigned int cpuid); const struct cpumask *cpu_coregroup_mask(int cpu); +#include + +/* Replace task scheduler's default frequency-invariant accounting */ +#define arch_scale_freq_capacity topology_get_freq_scale + #else static inline void init_cpu_topology(void) { } From patchwork Thu Jul 27 19:33:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 108855 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2484490qge; Thu, 27 Jul 2017 12:34:05 -0700 (PDT) X-Received: by 10.84.212.150 with SMTP id e22mr5453897pli.398.1501184045162; Thu, 27 Jul 2017 12:34:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501184045; cv=none; d=google.com; s=arc-20160816; b=kWX873YxvaaZjVfHGddKnsbyfRbcqBtcicG8HPMwmlh1GXgr7nlgbDqOYpeZFC99h5 +HgEplG23N3v5HcjRzzVkhFQIb7VmXV9yZI9CZ3555IRD0H62i9poP4FwCRasL36foDB LXBpWgN/DEZzSJOT9gP7/WZMn5cegaBK7/6oaLa84pLTG65dG3i5mT66gF18MM4DPT/P a3uzJ2UZGn76fmwO9TMubcoI75X/Wu/NWz9FmsmhC8i/hLDtG00G0WeBGhLdIf2sL5kc e2ocNBz49D/qBQ3dhp3ULQWIQab1LE150MuuWvS81XDAZ2RlQkBRJCN1uFfWWVg+ZiaG qrvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=PgP3eVNUa64DmraXtJ5paEmCpc8AK8CRSWm0pnYCp9o=; b=jg19NW1k2YZWhAhWhvmJwCyEtBFmrr6JJgx4z5TpGSXFKYz9RwaGOGA03G/WALjsV9 kHJk0f2944btTHYSAChWMgWxPvjdKtN59fFulduA9KH2n+lmfEdycM49E64fXnZxzpmE 2Za8NBHC7TnjejEAq1AP+pABs7k9KQIz7H/NEoAhxuN+0/aquyR/mEsv8sxaf+e0nIVR kHPCPAUYtBJwrV7nn/82UaewNckrIiwZD1BgJzz/tWFCf2LEGzxX2sVhgrJnR/IZ0z0l NLR22BAncQrepyPvZK1vVvlKnZkic20Jx+3vrfYNVyF5UP3jkYSjOstCWAAZCNtIBkA+ GXYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z63si3955997plh.986.2017.07.27.12.34.04; Thu, 27 Jul 2017 12:34:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751864AbdG0Td7 (ORCPT + 26 others); Thu, 27 Jul 2017 15:33:59 -0400 Received: from foss.arm.com ([217.140.101.70]:51146 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751788AbdG0Td5 (ORCPT ); Thu, 27 Jul 2017 15:33:57 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 45349165D; Thu, 27 Jul 2017 12:33:57 -0700 (PDT) Received: from e107985-lin.cambridge.arm.com (e107985-lin.cambridge.arm.com [10.1.210.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id ECC313F540; Thu, 27 Jul 2017 12:33:54 -0700 (PDT) From: Dietmar Eggemann To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org, linux@arm.linux.org.uk, Greg Kroah-Hartman , Russell King , Catalin Marinas , Will Deacon , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v3 08/10] arm: wire cpu-invariant accounting support up to the task scheduler Date: Thu, 27 Jul 2017 20:33:10 +0100 Message-Id: <20170727193312.9849-9-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170727193312.9849-1-dietmar.eggemann@arm.com> References: <20170727193312.9849-1-dietmar.eggemann@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 8cd5601c5060 ("sched/fair: Convert arch_scale_cpu_capacity() from weak function to #define") changed the wiring which now has to be done by associating arch_scale_cpu_capacity with the actual implementation provided by the architecture. Define arch_scale_cpu_capacity to use the arch_topology "driver" function topology_get_cpu_scale() for the task scheduler's cpu-invariant accounting instead of the default arch_scale_cpu_capacity() in kernel/sched/sched.h. Cc: Russell King Cc: Juri Lelli Signed-off-by: Dietmar Eggemann Acked-by: Vincent Guittot Tested-by: Juri Lelli Reviewed-by: Juri Lelli --- arch/arm/include/asm/topology.h | 3 +++ 1 file changed, 3 insertions(+) -- 2.11.0 diff --git a/arch/arm/include/asm/topology.h b/arch/arm/include/asm/topology.h index a56a9e24f4c0..b713e7223bc4 100644 --- a/arch/arm/include/asm/topology.h +++ b/arch/arm/include/asm/topology.h @@ -29,6 +29,9 @@ const struct cpumask *cpu_coregroup_mask(int cpu); /* Replace task scheduler's default frequency-invariant accounting */ #define arch_scale_freq_capacity topology_get_freq_scale +/* Replace task scheduler's default cpu-invariant accounting */ +#define arch_scale_cpu_capacity topology_get_cpu_scale + #else static inline void init_cpu_topology(void) { } From patchwork Thu Jul 27 19:33:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 108857 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2484699qge; Thu, 27 Jul 2017 12:34:20 -0700 (PDT) X-Received: by 10.98.158.66 with SMTP id s63mr1904882pfd.126.1501184060127; Thu, 27 Jul 2017 12:34:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501184060; cv=none; d=google.com; s=arc-20160816; b=zRytHd6WOHqMfoovG+vF2qv1yWEYPDxpeBK5Xny04KmCHLnVol4K2uBZoWOaSqetc1 TuoysYxSQR7SkUK82AJ6vimubDP6N7bJd7rRbBTBFo8QjBu8sQBVsVYxk6s+o6MzBH/3 ULOH6QvFm9g7Ny12EdBU5tBrbDf7Ix0DUx864xt05CHeCHKZuO0fF4D93HvGz1F3ZOaw KROCtBqE+3xQrCXDLebTzAu6WifNCeX8z5dW5yfuCHiJ/CBNQDF8WKRgsZFAXXP+tIv6 /5sVk7OhoJtrcI2LhpIf2AjSaNa4IJ/W7zewa4zTFXROciv5UA/XeeVWX1Qlc0rBcMF2 UVMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=3vV6a0L9Hx5d3aeIgf0AGkmxrQ4j/KylFjUT7+BNnSE=; b=y/uJv/E+nbPK20K+rcSkDKJRnF1rDGFd6ofp0s/41iVawimhD1ilsbWPRQf9fqCGwK C1ZO8UkuZXJ2sMYlny3naKf4EUM9fYVOwcPBP7B+QdMofYqzm2mAvBrVK3CrlI5q3ULY j4otT2t/gDjonJ2UWPbvFdSwk0SbqNBF8Jms28yoChD10ms9TzVBhp2IAV237kpxMHcH 81nN8foP+hg8pCxw5xOcvrBqVeXIhEhU7SFDOz+s03cp7HdtXXQLcIB3ZnOcjRPL4+wi dtxK2uusCyiond2/UZbij96H2O2qrlte4EAJadfNu/X8ThqObex4X9M8pYcTyK9EVs+e 773w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d187si6992658pfc.497.2017.07.27.12.34.19; Thu, 27 Jul 2017 12:34:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751885AbdG0TeD (ORCPT + 26 others); Thu, 27 Jul 2017 15:34:03 -0400 Received: from foss.arm.com ([217.140.101.70]:51154 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751788AbdG0TeA (ORCPT ); Thu, 27 Jul 2017 15:34:00 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 128BF1682; Thu, 27 Jul 2017 12:34:00 -0700 (PDT) Received: from e107985-lin.cambridge.arm.com (e107985-lin.cambridge.arm.com [10.1.210.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 820173F540; Thu, 27 Jul 2017 12:33:57 -0700 (PDT) From: Dietmar Eggemann To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org, linux@arm.linux.org.uk, Greg Kroah-Hartman , Russell King , Catalin Marinas , Will Deacon , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v3 09/10] arm64: wire frequency-invariant accounting support up to the task scheduler Date: Thu, 27 Jul 2017 20:33:11 +0100 Message-Id: <20170727193312.9849-10-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170727193312.9849-1-dietmar.eggemann@arm.com> References: <20170727193312.9849-1-dietmar.eggemann@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit dfbca41f3479 ("sched: Optimize freq invariant accounting") changed the wiring which now has to be done by associating arch_scale_freq_capacity with the actual implementation provided by the architecture. Define arch_scale_freq_capacity to use the arch_topology "driver" function topology_get_freq_scale() for the task scheduler's frequency-invariant accounting instead of the default arch_scale_freq_capacity() in kernel/sched/sched.h. Cc: Catalin Marinas Cc: Will Deacon Cc: Juri Lelli Signed-off-by: Dietmar Eggemann Acked-by: Catalin Marinas Acked-by: Vincent Guittot Tested-by: Juri Lelli Reviewed-by: Juri Lelli --- arch/arm64/include/asm/topology.h | 5 +++++ 1 file changed, 5 insertions(+) -- 2.11.0 diff --git a/arch/arm64/include/asm/topology.h b/arch/arm64/include/asm/topology.h index 8b57339823e9..44598a86ec4a 100644 --- a/arch/arm64/include/asm/topology.h +++ b/arch/arm64/include/asm/topology.h @@ -32,6 +32,11 @@ int pcibus_to_node(struct pci_bus *bus); #endif /* CONFIG_NUMA */ +#include + +/* Replace task scheduler's default frequency-invariant accounting */ +#define arch_scale_freq_capacity topology_get_freq_scale + #include #endif /* _ASM_ARM_TOPOLOGY_H */ From patchwork Thu Jul 27 19:33:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 108856 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2484519qge; Thu, 27 Jul 2017 12:34:07 -0700 (PDT) X-Received: by 10.98.80.89 with SMTP id e86mr5059342pfb.195.1501184047448; Thu, 27 Jul 2017 12:34:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501184047; cv=none; d=google.com; s=arc-20160816; b=X/R48xpBgidB4cwsnAtWqqkaAo7LyAOULjV+HObiR+Bf+QxvEpMNdavUApgdjhGwEd cLemV6PJYR18m/Qy0JYigcVHxM5F1JimU7fCOVeg35q8AMwvAtzakP+Ik8HJcYNCniad WXOXdQwm/+lvZOiEcg9l8m9ecy/Ww5ATbGR+KFkehceZmZCH0oxMXb+QTnyAiKZ6tZlm ak6gJjDqT5ljUUH/GFISgMpjGjeT68clCTl5E5momXH4MvlsDQ6YrouRYrTcft/qHn8v jMMLIBpRp2HQzR35Wgm2y2aawwfRTBocWQ9imhd2U3ZI95f4nPkHNNV5XCg2uFZEw6ve LkNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=9VKvKNMmVC/bp3thgbcBn1kdmeqitT73uM2X5sYlmdI=; b=Ieq/KplcgrwhYJPpqK2F8YZsUmbvBYCQL6+a6bnEfnVWn21isFMc/fHTFWUcKCoJZ7 iPLwASJ7A9Al14gtLkm+H8pQQ3PdP1wel4kSuXqYkSdUTKLJfLlRuExQfxKVgRD+qujg lyfnsHj2v0r2MK5mTVLu2A4iDwEUBpS9jOsWNUfPSBlVrr9X6Uz6LS8zfoGeXO0gANSg pcUfxFfsgHZJNVXqC/B2xAvhaxKnZknhgS8/fsadR1DfApRyiqu/3ltpVoLC+VYzY0I7 2mqncPSl8I62f4NgjuF4O3peCRE527ggM4rFEUyrKd7x6v4cgWzaAF+JjXTaF0kGAEj/ DGNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z63si3955997plh.986.2017.07.27.12.34.07; Thu, 27 Jul 2017 12:34:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751901AbdG0TeF (ORCPT + 26 others); Thu, 27 Jul 2017 15:34:05 -0400 Received: from foss.arm.com ([217.140.101.70]:51176 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751874AbdG0TeC (ORCPT ); Thu, 27 Jul 2017 15:34:02 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8786080D; Thu, 27 Jul 2017 12:34:02 -0700 (PDT) Received: from e107985-lin.cambridge.arm.com (e107985-lin.cambridge.arm.com [10.1.210.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4DE6C3F540; Thu, 27 Jul 2017 12:34:00 -0700 (PDT) From: Dietmar Eggemann To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org, linux@arm.linux.org.uk, Greg Kroah-Hartman , Russell King , Catalin Marinas , Will Deacon , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v3 10/10] arm64: wire cpu-invariant accounting support up to the task scheduler Date: Thu, 27 Jul 2017 20:33:12 +0100 Message-Id: <20170727193312.9849-11-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170727193312.9849-1-dietmar.eggemann@arm.com> References: <20170727193312.9849-1-dietmar.eggemann@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 8cd5601c5060 ("sched/fair: Convert arch_scale_cpu_capacity() from weak function to #define") changed the wiring which now has to be done by associating arch_scale_cpu_capacity with the actual implementation provided by the architecture. Define arch_scale_cpu_capacity to use the arch_topology "driver" function topology_get_cpu_scale() for the task scheduler's cpu-invariant accounting instead of the default arch_scale_cpu_capacity() in kernel/sched/sched.h. Cc: Catalin Marinas Cc: Will Deacon Cc: Juri Lelli Signed-off-by: Dietmar Eggemann Acked-by: Catalin Marinas Acked-by: Vincent Guittot Tested-by: Juri Lelli Reviewed-by: Juri Lelli --- arch/arm64/include/asm/topology.h | 3 +++ 1 file changed, 3 insertions(+) -- 2.11.0 diff --git a/arch/arm64/include/asm/topology.h b/arch/arm64/include/asm/topology.h index 44598a86ec4a..e313eeb10756 100644 --- a/arch/arm64/include/asm/topology.h +++ b/arch/arm64/include/asm/topology.h @@ -37,6 +37,9 @@ int pcibus_to_node(struct pci_bus *bus); /* Replace task scheduler's default frequency-invariant accounting */ #define arch_scale_freq_capacity topology_get_freq_scale +/* Replace task scheduler's default cpu-invariant accounting */ +#define arch_scale_cpu_capacity topology_get_cpu_scale + #include #endif /* _ASM_ARM_TOPOLOGY_H */