From patchwork Fri Aug 25 14:31:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 111029 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1048354ybm; Fri, 25 Aug 2017 07:35:15 -0700 (PDT) X-Received: by 10.101.73.136 with SMTP id r8mr10243279pgs.106.1503671715236; Fri, 25 Aug 2017 07:35:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503671715; cv=none; d=google.com; s=arc-20160816; b=V5PXM8wLg3K1g+Y7ZjQKRnlAgUAYmbliAOo1/xFVAshQNbTzTUw8HTTztcfp1aSY/E PODsSpaCLVWJG8mbyS5qmSNJQuPV7uatGb0LB6EdZQdfTI3wG8lIQn9nGL7arn+hdz/3 XRjRPRp0/j05u4XkeRJsJQDMXtgoC7LCGEuHz9l3D5JWhk+Ie9h3bP6Sq0p/euEa/NM5 hUiRnuLezz8Oh6gB8SM+0EjVqbCQhx107ZbwBl3DYSn43ZjyQxfIIw8rfdJaKvtr3Ig/ XaaVD3VnQ7zR9oiLIKQrSxsXQ4ObMtvfMdF5oy+5AiX1z3IFgKilIDPVyhY+TfGOuia6 8/GQ== 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=Od0gKFLU3pvY/QYoJKaVXTNGtxJq4cMSXEyqV4MwKdg=; b=FpPoLCzlonpg0TxyHvNCX93HakILWGy+4QSkDI4KMRneAk7u52IE5DVcJclfVuIyA/ TI6I0basSPszK7iNOg2kPTOV+5MDqspvDOa2Z1+kDXaKYEJDn69GgnNgY6aDcd3BhQoj NEZEfcuG0aPmz3GfXvyt9utokPWtjpbSezFHh3gnM6y2LuQjWenzMQfeGkVmOPmSZVVW lZSwdiTpP8GzQSMUWAQ7c3lLdY6gXrJKzk53U94ahZZOffLG45Mjh2aHrlv/FRYCClPp YA0nMsWnbLYKmc3K9YWDDlM1rRf6LDjQn24TF8MMdUNM73gDFdEZ3/hYZdaX3hSLLDHb MVzA== 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 k7si5458072pln.414.2017.08.25.07.35.14; Fri, 25 Aug 2017 07:35:15 -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 S1756829AbdHYOfM (ORCPT + 26 others); Fri, 25 Aug 2017 10:35:12 -0400 Received: from foss.arm.com ([217.140.101.70]:54032 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755713AbdHYOc3 (ORCPT ); Fri, 25 Aug 2017 10:32:29 -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 885E215B2; Fri, 25 Aug 2017 07:32:29 -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 96A673F540; Fri, 25 Aug 2017 07:32:27 -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 , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v4 01/10] drivers base/arch_topology: free cpumask cpus_to_visit Date: Fri, 25 Aug 2017 15:31:57 +0100 Message-Id: <20170825143206.30467-2-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170825143206.30467-1-dietmar.eggemann@arm.com> References: <20170825143206.30467-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 Acked-by: Viresh Kumar 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 Fri Aug 25 14:31:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 111028 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1047613ybm; Fri, 25 Aug 2017 07:34:34 -0700 (PDT) X-Received: by 10.99.4.16 with SMTP id 16mr10017961pge.236.1503671674288; Fri, 25 Aug 2017 07:34:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503671674; cv=none; d=google.com; s=arc-20160816; b=F+JKXqTdgBJWVFkwDRipdad6ZcHBGPaJub4Bz5gCxBkEvLAv5jBHJfN/ey9wS9C75c gBtsbV7oLkubflzCliFwb/dfiA1lu8z+a5Y9DIbaFsZMlot8+cc9FrO6BccNIhotuR5o IcEJV7IUS3UMRJBTdM4EA+pA8hy41Fm6ohVTKy+oQDKwQ++UkEL3zJsCifkZUxD0VPLZ URfIdm93lId8pQ8lNSUBwT8PA4/D7dnNUQYjU8cE6EUg24GL5LDOuPbyMpm+fEC/mI2b EYjmoUnfW5fR5gLZ1i7KBX6vAUOf/Q0aS035Nx2qvKHIjX7udp/HjvyvqZ8QU+rs7a/f 8h1A== 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=eUl3cjsIK1+wZadRXIK+hBxGBVddPHUpasj6TLpMcJM=; b=kiGSZQx+mCdc7V+Ku5xZ/J2TUZGZtbD2yhsht15HOh4hNcWatbfiWDVzyAP2F9x5MB aBfLONDetKkOrh10Yp1dpWVvMC6IHp+K0VsSOhkdRpLufvXorbhdaWiyOYv/t7Z2Q2Xe O3YOr3Oht4NaonWXbyEHtih6IsAqn7v/UALN8EyeLTVqJMRt98Y7ALIwVStqNmtwtdi0 fsubEdxa+67ZHcP4ABhEemCuQJ0ANkepTozx801xopM1GH4iLZ4iadE4528L+CHkbOnN Bau9mie38bh4JUTCbo8xZ4YpMaLHWReOp/fJ+SRUYRBFOc+m/XAcojAEWf3/vOdgah12 GCfQ== 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 m11si4030767pla.363.2017.08.25.07.34.33; Fri, 25 Aug 2017 07:34:34 -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 S1756496AbdHYOec (ORCPT + 26 others); Fri, 25 Aug 2017 10:34:32 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:54066 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756692AbdHYOce (ORCPT ); Fri, 25 Aug 2017 10:32:34 -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 E407D1682; Fri, 25 Aug 2017 07:32:33 -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 F1FB33F540; Fri, 25 Aug 2017 07:32:31 -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 , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v4 03/10] cpufreq: arm_big_little: invoke frequency-invariance setter function Date: Fri, 25 Aug 2017 15:31:59 +0100 Message-Id: <20170825143206.30467-4-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170825143206.30467-1-dietmar.eggemann@arm.com> References: <20170825143206.30467-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 Acked-by: Viresh Kumar --- drivers/cpufreq/arm_big_little.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) -- 2.11.0 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 Fri Aug 25 14:32:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 111021 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1045515ybm; Fri, 25 Aug 2017 07:32:43 -0700 (PDT) X-Received: by 10.99.185.16 with SMTP id z16mr9731921pge.395.1503671563045; Fri, 25 Aug 2017 07:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503671563; cv=none; d=google.com; s=arc-20160816; b=ckJOG2fEeK0mnbS6i95KpcB+LvjewCNvGDUOXFsP8qBtUIg/nJCm6OIArzv0zgcO6a 9I/Yul3TnMtTstmqTMjZ7UG4AUJc45VBFMsV6ocbz5eRkg3mWBq3KC23t+bf6ex3R9dM 8qaeVlCo+r3iGgZL9ffAfHfCj40Hqa9VKJAgfvPWo7aMaHpnKxEyV26KMCJQGBdJV2fV TPshAYZM6kNKC/uDHPru/P38WE8JLIl+SE4LzKwLxFc1XrDqZX0+632Vb/ion5QJ/0IN RtofiOwp4V5GVVP4psvWQvGCKPBboViFjCkCEZrJcnYgOgLIGEQijiWBun1zAnmYX77C DdDg== 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=OBnYimGH1/H1SbR09O3MMUsSKNahhfRmLx5wiy4AddQ=; b=nz4Z5vtoASwz4h5FExK4bIiN/iies5mTq8zdm68N/9d+PcIxT3P0t8E4XVZWBkB7/k pP89/ILGSPmHoem9bAODYV/XT5uRw6/5IlUQVZhsvZIeSUhMq6E772O0ItmheHWotmj1 tsWJcYFsgqlCTAhu285UYwy4g4Ld2+wgFnhNjQbZmMjODtRVYMpQNReJKp7wsjLNbiZX Q99nxTVQf74P+eRNs23GjiMmBVxksT6222i/jp2sDtiWyEPrFAxjdBhlyoF1LGP0hwGu gYspeWEn+7bPmw0XdGnlobM8432o4n/m8JEhBsf7oA2ed7yf7sCFxPJRm8cBoFA7vtm5 cxgA== 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 a1si5061466pln.371.2017.08.25.07.32.42; Fri, 25 Aug 2017 07:32:43 -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 S932730AbdHYOcj (ORCPT + 26 others); Fri, 25 Aug 2017 10:32:39 -0400 Received: from foss.arm.com ([217.140.101.70]:54072 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756769AbdHYOcg (ORCPT ); Fri, 25 Aug 2017 10:32:36 -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 2600B168F; Fri, 25 Aug 2017 07:32:36 -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 2BAA23F540; Fri, 25 Aug 2017 07:32:34 -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 , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v4 04/10] cpufreq: dt: invoke frequency-invariance setter function Date: Fri, 25 Aug 2017 15:32:00 +0100 Message-Id: <20170825143206.30467-5-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170825143206.30467-1-dietmar.eggemann@arm.com> References: <20170825143206.30467-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 Acked-by: Viresh Kumar --- 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 Fri Aug 25 14:32:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 111027 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1047241ybm; Fri, 25 Aug 2017 07:34:14 -0700 (PDT) X-Received: by 10.98.217.210 with SMTP id b79mr9651875pfl.110.1503671653905; Fri, 25 Aug 2017 07:34:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503671653; cv=none; d=google.com; s=arc-20160816; b=byOlhvQIfFaOinfN4RzSRBa48jNwd+GqNfyIc+SALY5OZizT8Epqu688LD05SwLmjk n9iKeWbaMdMyF6qeDypftsu1cQWq3YxSVIMLemNNUiCYPkc/yNTk3IY9u3gpQZ+m+rES +/+sn1trSlAREK6Z3bgrbvaUL0Atr6GyWTpmH9LrLakF3MpKw8wNetPb2ICaDsQ4cG5l ff177aueRuaqYHG2gxSLBrgyqGEpuLO7y0ljA7Q989cHErd//7oHVfCk58qxBi8TqUER kD+ySG9lWKnRpTjnzgpEIaV86FQvl0mAznJefcp0+i6ao0ZnsbNaXTC9bw/s+2A+yC7i VzmQ== 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=UQ3+aAZRm6PDo7U45jQBSwfDinVXgAhyc7tC3AXeMS0=; b=Sr+H4x36/EHty5j7QibJ0EXVEwnryGLHsgGxGqdKjKqjlpOsgqR0o3sbktvP42pKTH 6qVc9X9bf4ySaFqaFIIbIoFrXp5vU1HXq93blGVJAMSTsE57Mvp9POSxgyaCrYA/49pH LfHYH7VvhLkGHBZx0r6iUGrQO17UEA+V3me23oL1HuloxTF5iR6mcUGPIWOxIQDFDare N02w3sswWY8DV1p+f8KaprR4K7czMR4RbewSZOuKukM7t/jPvM9gYKkpHMHbJ6G4uB/q sYVmw40HnAJ40T2iKHsxmg5lZHQyE7U6Tsm/ECsBk2EwuXu3ESQmuo7Rl+pAzEe2ravi kEmw== 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 123si4745946pgb.416.2017.08.25.07.34.11; Fri, 25 Aug 2017 07:34:13 -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 S933365AbdHYOeJ (ORCPT + 26 others); Fri, 25 Aug 2017 10:34:09 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:54086 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754632AbdHYOci (ORCPT ); Fri, 25 Aug 2017 10:32:38 -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 536FE169E; Fri, 25 Aug 2017 07:32:38 -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 61ABD3F540; Fri, 25 Aug 2017 07:32:36 -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 , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v4 05/10] drivers base/arch_topology: provide frequency-invariant accounting support Date: Fri, 25 Aug 2017 15:32:01 +0100 Message-Id: <20170825143206.30467-6-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170825143206.30467-1-dietmar.eggemann@arm.com> References: <20170825143206.30467-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 Acked-by: Viresh Kumar --- 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 Fri Aug 25 14:32:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 111023 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1045623ybm; Fri, 25 Aug 2017 07:32:49 -0700 (PDT) X-Received: by 10.99.124.74 with SMTP id l10mr7947543pgn.261.1503671569233; Fri, 25 Aug 2017 07:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503671569; cv=none; d=google.com; s=arc-20160816; b=i0myBbxXIAwblJ3cUbSRYgsBRRxy4PYphdQBg4QLlJgXigBVp5TVTRmb84bTwb9xkt XydYYviWQKA4sCljbDRkxBOtWUEJpI+W8wHssGWadHiuxP5zjdgRt2fZSdjl6Rnt/dq9 GdcqHmkuUeEgA2Hk+O7jlEtlxoPGlm7G2fLD1mtxJR50foEDGEA+xhcHBytJTvFhp/bo Fo1jqYCYy6v1D/YEdlHTgpQWxee77KGZFjZkVRnCPvxy2St/GWTrIygBoa69WG8A4tjM 2DOI7P6OKb31yGVCeeOTf/Asn2G+mV98LdNXRpTexLcWc6ceQUHpwD2iIJadS5Vaeo58 ZjDQ== 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=hdDRcaOvy4fipxHN/7p3et/BSX1b40gvOxz3uIqNP1s=; b=r4M8XCB/IKTgrGDnTmhlHQxHbh38qOBYNGDuicBJ2lENkYANKH6IihHQP3DJEPjYKI 808XOq5diJQQBeSsS9qmKp8g8p2hAR+NsltHpSVOsg6Y5XkCwFdMRsNikOFnaZHBf2zy wKRjQkCU8A6Okw4YSF7TddRWp0XMXIP2Th0HSC/Jw3k/rVnSqFgE9Lk8ufOyAjXg/0QT OQcU/FNTYCH4nd/LyKVt9L1vN/itje1xdrIVQlAnFT/piGRnClwYz+PdYpvDt1UnkF4x W9od6Y71nz+igpi25sytDp9jY/t3+uF2T/jDX1waeKGmI10Xv6+D+y62VMt/mzd/3NA2 dVWw== 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 e23si5366940pli.113.2017.08.25.07.32.48; Fri, 25 Aug 2017 07:32:49 -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 S932860AbdHYOco (ORCPT + 26 others); Fri, 25 Aug 2017 10:32:44 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:54100 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932735AbdHYOck (ORCPT ); Fri, 25 Aug 2017 10:32: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 80C271715; Fri, 25 Aug 2017 07:32:40 -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 8F1D03F540; Fri, 25 Aug 2017 07:32:38 -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 , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v4 06/10] drivers base/arch_topology: allow inlining cpu-invariant accounting support Date: Fri, 25 Aug 2017 15:32:02 +0100 Message-Id: <20170825143206.30467-7-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170825143206.30467-1-dietmar.eggemann@arm.com> References: <20170825143206.30467-1-dietmar.eggemann@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Allow inlining of topology_get_cpu_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 Acked-by: Viresh Kumar --- drivers/base/arch_topology.c | 7 +------ include/linux/arch_topology.h | 8 +++++++- 2 files changed, 8 insertions(+), 7 deletions(-) -- 2.11.0 diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index af9ab98a233e..c8cd92ba4cc0 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -37,12 +37,7 @@ void arch_set_freq_scale(struct cpumask *cpus, unsigned long cur_freq, } static DEFINE_MUTEX(cpu_scale_mutex); -static DEFINE_PER_CPU(unsigned long, cpu_scale) = SCHED_CAPACITY_SCALE; - -unsigned long topology_get_cpu_scale(struct sched_domain *sd, int cpu) -{ - return per_cpu(cpu_scale, cpu); -} +DEFINE_PER_CPU(unsigned long, cpu_scale) = SCHED_CAPACITY_SCALE; void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity) { diff --git a/include/linux/arch_topology.h b/include/linux/arch_topology.h index 3e3c2657c9a1..0c4e43d6a3bb 100644 --- a/include/linux/arch_topology.h +++ b/include/linux/arch_topology.h @@ -11,8 +11,14 @@ void topology_normalize_cpu_scale(void); struct device_node; int topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu); +DECLARE_PER_CPU(unsigned long, cpu_scale); + struct sched_domain; -unsigned long topology_get_cpu_scale(struct sched_domain *sd, int cpu); +static inline +unsigned long topology_get_cpu_scale(struct sched_domain *sd, int cpu) +{ + return per_cpu(cpu_scale, cpu); +} void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity); From patchwork Fri Aug 25 14:32: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: 111026 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1046733ybm; Fri, 25 Aug 2017 07:33:48 -0700 (PDT) X-Received: by 10.99.109.68 with SMTP id i65mr10072492pgc.190.1503671628501; Fri, 25 Aug 2017 07:33:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503671628; cv=none; d=google.com; s=arc-20160816; b=bOcfp6+YcCiGWeTMXyhkdHFsNmLdEqd8qN2RB8N3RMHNfv5Vyxhy8tiiZwoZJ8VsES 0O7mOF0W4P7B72ogShTnz6XBkOm0VEi1F7yDXxUtO9Mizg4ykxzsKvuvSy+3bIaMkHVW 5BJTKphllQwr/yhBF/csWkVF64as7Psc/iixpVT+yK7A6znTdOgDTQyUhfj6pO0790NR +6a+PWyCntpxKVFC6pN8XxH4EDOBNksV9D5U6sB9ZgrWxTTALx9hmTpgJLTcINmqPZbE 0FJl6t+yBgnP0fz9QGJ3iL06LytUJSo9hjJ2PRM0MVyjtsxteqi9IiygWpEifMcCo4GF aUyQ== 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=3m10bSJjk0GQ/G6RTLboTmEichiRL/wDkH5R6pDckRM=; b=0+4k/Ycij8d4nO5b9vl+ujyPlwU06rLgOA+8nkxZl+UULdArFUfJQpemYyLMQ6u08W Q+o/GiraAdhAB7iGA9innfDVBbybJGOGwBxPsATXj0T3Shi8x/bxvN1bejvFEJggN+B3 j611rxKxTZ9F3UqGzHmCf46qS0OiF+VZPn8s8EDoEBCoPBJ2F+/SxeZ5q+yZjQMbit03 M4JeMU/j6C+idU4D2KYe4RqUeKWkdwEgW6n0ZTvspgDYR071uPMY+LMeIcPRvVeD1mNv ocXl6/6EFkHmhUq/lOpKCknVKQauJeuNPG0HTi5NjhDpQ2BXWJKMCPtz7d1e8GTNUNra +pqw== 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 33si2835702plv.203.2017.08.25.07.33.48; Fri, 25 Aug 2017 07:33:48 -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 S933271AbdHYOdp (ORCPT + 26 others); Fri, 25 Aug 2017 10:33:45 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:54112 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932619AbdHYOcn (ORCPT ); Fri, 25 Aug 2017 10:32:43 -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 AF1BF1991; Fri, 25 Aug 2017 07:32: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 BCE523F540; Fri, 25 Aug 2017 07:32:40 -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 , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v4 07/10] arm: wire frequency-invariant accounting support up to the task scheduler Date: Fri, 25 Aug 2017 15:32:03 +0100 Message-Id: <20170825143206.30467-8-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170825143206.30467-1-dietmar.eggemann@arm.com> References: <20170825143206.30467-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 Acked-by: Russell King 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 Fri Aug 25 14:32: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: 111024 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1045660ybm; Fri, 25 Aug 2017 07:32:52 -0700 (PDT) X-Received: by 10.98.85.2 with SMTP id j2mr8018434pfb.35.1503671572024; Fri, 25 Aug 2017 07:32:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503671572; cv=none; d=google.com; s=arc-20160816; b=nab4kipwj0fwpi4+aUwFBhs6hslL/J6ssIxblL3snWOk9P97RSxgSqzkFeBe9+iuev +9bTn8k/DbkovmidKsho6bME6cKu9uXtSQHSg25F+8B0xMVup4SzYFOolARIsTMsxX0B 1aluBz66zbkvAM+rKM6AVzOJDze1qYdA9Qo4GhVWj9zdIjcKu1m2hjungGNWLPFGyTLR 9GvWWQ4jjHAIHIAMeONG+NuZNDmRChXZcDI8Rl4Vr3ItphylM8k2tezvFd7WJ55KplmM 7bunvdz41JJ+fGlFe73cz4mELVgse5l8SKZxTbM0njxGFpb38LEQ/7WtjS1+ILiLfK2e RXfw== 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=kmxM66wPc+HCcOh3BBFcvLsBusBBTM0UNOPIPOFiWWxRf/Jx0Wc4m7tBdJYWfYzrQY so1rIV4KI0Yqxc7szbHtySwjgFieduirohF8F729NYrudHccFsC+amd2GWaDQD8omA1k fuKLAsRjniusLiZ1OtEeOJygQnKsZ0KnUIs2F1iVoCRkh+5rfVpl4p47IIWJFAHCdUx7 wLWcgKNC7i1N+HaGg224onqPN+Vtib4I6U9PY1smX2IKhBmdqFuAooJi1RR9YYa58QR0 aMmHONQYeS3ph5SnawrdxxfOC26FNttwFN+10EV4p5MvAnma2Hd858CxGOr73yxEbtD+ TZvA== 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 b76si4829213pfe.514.2017.08.25.07.32.51; Fri, 25 Aug 2017 07:32:52 -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 S932983AbdHYOct (ORCPT + 26 others); Fri, 25 Aug 2017 10:32:49 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:54142 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932735AbdHYOcr (ORCPT ); Fri, 25 Aug 2017 10:32: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 168E51B4B; Fri, 25 Aug 2017 07:32: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 2476D3F540; Fri, 25 Aug 2017 07:32:45 -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 , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v4 09/10] arm64: wire frequency-invariant accounting support up to the task scheduler Date: Fri, 25 Aug 2017 15:32:05 +0100 Message-Id: <20170825143206.30467-10-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170825143206.30467-1-dietmar.eggemann@arm.com> References: <20170825143206.30467-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 Fri Aug 25 14:32: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: 111025 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1045794ybm; Fri, 25 Aug 2017 07:32:59 -0700 (PDT) X-Received: by 10.99.53.202 with SMTP id c193mr1766998pga.444.1503671578872; Fri, 25 Aug 2017 07:32:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503671578; cv=none; d=google.com; s=arc-20160816; b=hBk5bZi1KSM58v/ZKiP5T8DlBrFhnbkOXG4wu5M0hUjyyE+Ql8TIH5OdDt3YDyfSL6 4cZ4NlY69FZDy63ibsKBApVqDtIWky3nLCvnbz87g7l5RXH0COQdpubJVCTxW1U2wpsW HafGM0SoEAi0QH1MOJ3u3VvugOHclM1fqHsy/Wfue923K4cT8TDkw/c5a1Z/HkneksLx Wp75etN7IgQfR1czEfzv15e5wsklT0TbJHSYJytjKI41GnDzB+A1RwhDuvurfFVc8hdV fLSPW7hS6SPw1QvjiolVDRAGaB983dnStWJ5J72D2xFps/PopQCEcUQLh9PzK1kfaVnb 6NOg== 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=OLvqbdnvA1TL6bFhhe6nrbTBD8gIcyMsPacFrTZjQ6EKCpXZS/Nr+6pE78cemulgkJ B+6vchCdtATD/j0g81IbDfGgx6ui6XzlHO1FZyPBF5LFWNV3r7Dk7wqTdi4JzDBQwRr0 +RXwGbUlhHZOaA2yxWRfR/QTHi6kYZumYLdKi1StIEG4hFQZ1TAHJdsU7ybm8AFiDmi1 ekEcPHxiLXMgqvfPz2UwddrANflHtxTNvfsJMDaRQ32KMbYRWS02WHMsie8+K515yIOs kuhtHBdTqWkcYgomWvEp637WVMZs46RGafSuhI0Vt/iC5+OcvlUe9wHiiWaoUAaqiFp4 TwkA== 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 i6si5101667plk.463.2017.08.25.07.32.58; Fri, 25 Aug 2017 07:32:58 -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 S933019AbdHYOcz (ORCPT + 26 others); Fri, 25 Aug 2017 10:32:55 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:54160 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932974AbdHYOct (ORCPT ); Fri, 25 Aug 2017 10:32:49 -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 450DA1B5E; Fri, 25 Aug 2017 07:32: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 533F83F540; Fri, 25 Aug 2017 07:32: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 , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v4 10/10] arm64: wire cpu-invariant accounting support up to the task scheduler Date: Fri, 25 Aug 2017 15:32:06 +0100 Message-Id: <20170825143206.30467-11-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170825143206.30467-1-dietmar.eggemann@arm.com> References: <20170825143206.30467-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 */