From patchwork Thu Jul 6 09:49:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 107095 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1881642qge; Thu, 6 Jul 2017 02:50:38 -0700 (PDT) X-Received: by 10.84.224.4 with SMTP id r4mr27494371plj.85.1499334638189; Thu, 06 Jul 2017 02:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499334638; cv=none; d=google.com; s=arc-20160816; b=qtSCz7Sw4PUlQk7mVYPaZpwzjbULD/GEzonhm9MU3yENSSPQNVH/c9TP5ndQ0U+GEf iPgxxhTry2RHM9yH1k6OOFysInfKCs0TNaXDdFEuoS88OPtNGo3PqrRoGCz1dV2laKQw eH85YaPow3DzW2CqLg30mZDlgKIUr1oz5HiekoHt+Oea5T+D/VR3VFe0Z6rSEq8idX5I kfSyTDaRJM/yjEihfj/JujNwvhd3dWYdK4CwpoEma6BUy1aBkXjZhnESI5ZngpVT7A4O kyOhM/o7OyFvYvgTOvjIBw3NjFfbCgkeBlLWrt55ziVmlD9PItT1JEwjQvAFReLiLAus cykQ== 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=XD6HOrob8RxDHHkYKav2Wx3BsPjBcbA3cltxkhwzFBg=; b=b8c+gyJMJj/GC1DpguE4pJwXWofCQqwSFa6lfo482GFpGulsOF/xR9M99Y1PRk5pOI cSMXk4BIpZfWgF1q7qwzsErECSj5Af/SVkhbVY2D2aUP4W32kEBSYshGFdtR3dgW4Xyd vQPuDoFmFYuRH44qXLeQjRmiXMQiKy19iDPJKeiv1Xl3Of01iPLNw7ZTi+hpVctmowTV 4EKSvTARHlgMd0G/JSAEYaKzxUS1wQCWFdEQhHdHcMQtbEfgeUHWfXmwrn3RHMLG4rXb zxDs2vE/4Yw057PHW08cqILFz7obmWuIU9PiPXOwtp25y37tL7GUCOAUOE1KO4v2mEYf jrWw== 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 l74si1153861pfb.386.2017.07.06.02.50.37; Thu, 06 Jul 2017 02:50:38 -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 S1752347AbdGFJuY (ORCPT + 25 others); Thu, 6 Jul 2017 05:50:24 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:36086 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751057AbdGFJuV (ORCPT ); Thu, 6 Jul 2017 05:50:21 -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 5337615BE; Thu, 6 Jul 2017 02:50:20 -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 4E0013F3E1; Thu, 6 Jul 2017 02:50:18 -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" Subject: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant load-tracking support Date: Thu, 6 Jul 2017 10:49:40 +0100 Message-Id: <20170706094948.8779-3-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170706094948.8779-1-dietmar.eggemann@arm.com> References: <20170706094948.8779-1-dietmar.eggemann@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A frequency-invariant load-tracking solution based on cpufreq transition notifier will not work for future fast frequency switching policies. That is why a different solution is presented with this patch. Let cpufreq call the function arch_set_freq_scale() to pass the current frequency, the max supported frequency and the cpumask of the related cpus to a consumer (an arch) which defines arch_set_freq_scale(). The consumer has to associate arch_set_freq_scale with the name of its own implementation foo_set_freq_scale() to overwrite the empty standard definition in drivers/cpufreq/cpufreq.c. An arch could do this in one of its arch-specific header files (e.g. arch/$ARCH/include/asm/topology.h) which gets included in drivers/cpufreq/cpufreq.c. In case arch_set_freq_scale() is not defined (and because of the pr_debug() drivers/cpufreq/cpufreq.c is not compiled with -DDEBUG) the function cpufreq_set_freq_scale() gets compiled out. Cc: Rafael J. Wysocki Cc: Viresh Kumar Signed-off-by: Dietmar Eggemann --- drivers/cpufreq/cpufreq.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) -- 2.11.0 diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 9bf97a366029..a04c5886a5ce 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -347,6 +347,28 @@ static void __cpufreq_notify_transition(struct cpufreq_policy *policy, } } +/********************************************************************* + * FREQUENCY INVARIANT CPU CAPACITY SUPPORT * + *********************************************************************/ + +#ifndef arch_set_freq_scale +static void arch_set_freq_scale(struct cpumask *cpus, unsigned long cur_freq, + unsigned long max_freq) +{} +#endif + +static void cpufreq_set_freq_scale(struct cpufreq_policy *policy, + struct cpufreq_freqs *freqs) +{ + unsigned long cur_freq = freqs ? freqs->new : policy->cur; + unsigned long max_freq = policy->cpuinfo.max_freq; + + pr_debug("cpus %*pbl cur/cur max freq %lu/%lu kHz\n", + cpumask_pr_args(policy->related_cpus), cur_freq, max_freq); + + arch_set_freq_scale(policy->related_cpus, cur_freq, max_freq); +} + /** * cpufreq_notify_transition - call notifier chain and adjust_jiffies * on frequency transition. @@ -405,6 +427,8 @@ void cpufreq_freq_transition_begin(struct cpufreq_policy *policy, spin_unlock(&policy->transition_lock); + cpufreq_set_freq_scale(policy, freqs); + cpufreq_notify_transition(policy, freqs, CPUFREQ_PRECHANGE); } EXPORT_SYMBOL_GPL(cpufreq_freq_transition_begin); @@ -2203,6 +2227,8 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy, blocking_notifier_call_chain(&cpufreq_policy_notifier_list, CPUFREQ_NOTIFY, new_policy); + cpufreq_set_freq_scale(new_policy, NULL); + policy->min = new_policy->min; policy->max = new_policy->max; From patchwork Thu Jul 6 09:49:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 107105 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1883115qge; Thu, 6 Jul 2017 02:52:30 -0700 (PDT) X-Received: by 10.99.6.145 with SMTP id 139mr25403458pgg.157.1499334750110; Thu, 06 Jul 2017 02:52:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499334750; cv=none; d=google.com; s=arc-20160816; b=Xr6wk5Ug4OKeAUDZcqV2jjqsOaKB6YThk6B9ItuIcxSbRmwMNs6C4OYrS0y4kLmaTJ OQ28IfvpA4U3tZYopBY/32/eDAQy8EIoDXgxTmIrxEkJyeRIua5MTl2SJlioqZTbEwNz VhTfkLH9cjleJ3IDJsWl96T/Q1TUgCQ0amRL7izri5+/V8ZZWKSwTKs6b6jhQ83yG2lZ 0PwRRdOPOKa/BYeLT++kwpmsPe5KWZv7N87VjkVwRIWWlqJ2IC0hmYtUnvnlauAW8guz DgXqknq321ghhpZxX/qJ5C2VRo8xjpYGW1Osn/mb3iFGArC1z+SDqY/nnzpNFXbOjamE NQdw== 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=TZkHLwvNAaPxhK8hIQ1D9gwtO7t5CaSiI18qISl6Ffs=; b=kpDCxnf8I8A4moLylbKFo4RTXpJHAsh8n3K1/Rd1kSbkduEAyvy3SQuXiuyAlGMdaZ psX4urP2Hz8uNNorDhboVyCr4SHElc7Lv0g3BmG/567/zhvVbCxffqcgN3aAgt/eXjW4 8+kkaFC2VNNEht1LDFTALJu/Ahdhh4L75uF5KYgLLV8/tzItqkzCTpGgsZa2HVlxVRQF sCpUBgKRQX2gdCTNgCkGiewN19/4OjtrBEkwBuG/i4AgOA/3S4YLTuYRJ9T8xOrDK2kv 3lQSHUAVGExPr0lGeHsTMrcN9GqJ+aG4Rw5P/736+Zy38e8H0g8pUvzNMtAiVTZxYcuU mQuA== 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 x5si1133541pgj.373.2017.07.06.02.52.29; Thu, 06 Jul 2017 02:52:30 -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 S1752642AbdGFJwG (ORCPT + 25 others); Thu, 6 Jul 2017 05:52:06 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:36086 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752222AbdGFJuW (ORCPT ); Thu, 6 Jul 2017 05:50:22 -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 8D3D715BF; Thu, 6 Jul 2017 02:50:22 -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 8EF473F3E1; Thu, 6 Jul 2017 02:50:20 -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" Subject: [PATCH v2 03/10] drivers base/arch_topology: frequency-invariant load-tracking support Date: Thu, 6 Jul 2017 10:49:41 +0100 Message-Id: <20170706094948.8779-4-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170706094948.8779-1-dietmar.eggemann@arm.com> References: <20170706094948.8779-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 an arch-specific frequency-scaling function topology_get_freq_scale() which provides the following frequency scaling factor: current_freq(cpu) << SCHED_CAPACITY_SHIFT / max_supported_freq(cpu) One possible consumer of this is the Per-Entity Load Tracking (PELT) mechanism of the task scheduler. Cc: Greg Kroah-Hartman Cc: Juri Lelli Signed-off-by: Dietmar Eggemann --- drivers/base/arch_topology.c | 20 ++++++++++++++++++++ include/linux/arch_topology.h | 7 +++++++ 2 files changed, 27 insertions(+) -- 2.11.0 Reviewed-by: Viresh Kumar diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index f4832c662762..63fb3f945d21 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -22,6 +22,26 @@ #include #include +static DEFINE_PER_CPU(unsigned long, freq_scale) = SCHED_CAPACITY_SCALE; + +unsigned long topology_get_freq_scale(struct sched_domain *sd, int cpu) +{ + return per_cpu(freq_scale, cpu); +} + +void topology_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..168104d2d2cf 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,9 @@ unsigned long topology_get_cpu_scale(struct sched_domain *sd, int cpu); void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity); +unsigned long topology_get_freq_scale(struct sched_domain *sd, int cpu); + +void topology_set_freq_scale(struct cpumask *cpus, unsigned long cur_freq, + unsigned long max_freq); + #endif /* _LINUX_ARCH_TOPOLOGY_H_ */ From patchwork Thu Jul 6 09:49:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 107096 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1881648qge; Thu, 6 Jul 2017 02:50:38 -0700 (PDT) X-Received: by 10.84.231.196 with SMTP id g4mr27376541pln.34.1499334638537; Thu, 06 Jul 2017 02:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499334638; cv=none; d=google.com; s=arc-20160816; b=Ld78yGyUzDSqOlqy84iEzNzXVirb9Ld2ikH2ZLlHVnuU3RXCCy9e3U0cCSLVWSrdBj ZYQLIz7XzNqHgvmSRrIUuaXD2whKEFrT2OAH/0lcoZYZ6YRj4IwTBTT7tWbtsmd+nNYk U3b0ww2GgkXgiTdJhNFHUdEVcCemi/Ju2Cj4Rs2Ze/bp0jieCEwHKUaruWvNBcBiL3mz Lec9auL3p7Pflqo1N2DJf/9c2k2fMKtfBMfT9b1t7d7q31muJTN1KJptCebCwj9fFCnL /1pdRcqlGw9o+Xfg6OxvoyttZqNERc8y+PJk9pLvTb8I9IQp4WkIdQRjmtGRw3srVhfT EOhw== 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=g82EFz3IHJGuGvAzQnjyfdy7yG60ZaUhSeok6GT/pWI=; b=r8TrZuiLIGaD81a4w0dgpD5Ybcn8vtLUCkITyAWLiehDpHT4ceXjv/HGpnJ3RmYags 3A6wqsazRiQPtwiAOcG9oam9CkxgleryI8sIXEhQoe9J9KqPh1NmcrnlBT7J5sHJoNFN vGDwaT/xtFnlcwOSXGbVGoBqybTLw2EXDkSq0OUwfMbKI2T1HeV/n4OFLpgOnkg2LtjT Dk/46PvZvHGGIHmJ/us2wqTdZ4io1Fexp/859PpvuDukvgxPBEcTYIZNbIgu7kjuWw/y r1jrrT3ni2D0qDj1pGSME4hIWjm2nRPYMcYAmbBCYQjb0Cmuv/jvI065tAboxGNYuVgF nXCA== 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 l74si1153861pfb.386.2017.07.06.02.50.38; Thu, 06 Jul 2017 02:50:38 -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 S1752396AbdGFJu2 (ORCPT + 25 others); Thu, 6 Jul 2017 05:50:28 -0400 Received: from foss.arm.com ([217.140.101.70]:36120 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751057AbdGFJuZ (ORCPT ); Thu, 6 Jul 2017 05:50:25 -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 C3C5F164F; Thu, 6 Jul 2017 02:50:24 -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 C87303F3E1; Thu, 6 Jul 2017 02:50:22 -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" Subject: [PATCH v2 04/10] arm: wire cpufreq input data for frequency-invariant accounting up to the arch Date: Thu, 6 Jul 2017 10:49:42 +0100 Message-Id: <20170706094948.8779-5-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170706094948.8779-1-dietmar.eggemann@arm.com> References: <20170706094948.8779-1-dietmar.eggemann@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Define arch_set_freq_scale to be the arch_topology "driver" function topology_set_freq_scale() to let FIE work correctly. Cc: Russell King Cc: Juri Lelli Signed-off-by: Dietmar Eggemann --- arch/arm/include/asm/topology.h | 5 +++++ arch/arm/kernel/topology.c | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) -- 2.11.0 diff --git a/arch/arm/include/asm/topology.h b/arch/arm/include/asm/topology.h index 370f7a732900..ca05d1b90411 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 + +/* Subscribe for input data for frequency-invariant load-tracking */ +#define arch_set_freq_scale topology_set_freq_scale + #else static inline void init_cpu_topology(void) { } diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index bf949a763dbe..2c47a76c67b0 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -11,7 +11,6 @@ * for more details. */ -#include #include #include #include From patchwork Thu Jul 6 09:49:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 107097 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1881654qge; Thu, 6 Jul 2017 02:50:39 -0700 (PDT) X-Received: by 10.99.119.12 with SMTP id s12mr25156238pgc.143.1499334638930; Thu, 06 Jul 2017 02:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499334638; cv=none; d=google.com; s=arc-20160816; b=RY3Pg8XUkFPoqXaJy4cYgz3WsGAbzwPCSpNN0tXHvzZOiF9oD/1xC1vVr5T8OTR1Op Cw8wnCcmBxVFlcBBEYQqNrkC/4JAkxoL4gF12mTfrvPxovIYmtN+bZBgjyUrjQVHrbQp a6+yUskEUSi0FSl9o9XrH8XyQsvIJAMvFpcSOikGbkpDm9VqKl2RTogvnGL7ampRaf+i a2aWlkUa3pXnBHRXaNmLFagUkPI+OsROEKLNxp1IXhCt8Gcxa0D6Js6CZ7z3Js6BCR2H gKVFTMBVd1ZhOo8YD60xPshIiVEswFmBXZbUmVDMUWazI8tsq3t+WJdDwUjbhHvLsj2Q Nnvg== 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=xYIUud0vS+aSWK8aqEj3PNW/8YQlIFuIK7tD0NJixJY=; b=d4kAogYf3+mUterMzR4AA+ODyJzX6BAd5dryl89sRpM17HyesrVrruxXbvBXZslAvH b0UjFWpHzlHNzbdztURHJfh++pjgPQBOo9LvfXOKD41m1a9qmTBXH+deWhRogoDA9jGP uWZpLrvCeW1byC1ZC+nQl0G9jhTwUvRAsW7TT+c9UUhz4xPPxJEygFH+JOnzUsxyvCPt olkWYMKj3Ps98Xt4Fnfo9iqqgKGc6AsCEKRZSzZW6IsXky6xWZ7wiHpAER1rrz3ZRPIp f4zX5seDlj19+1qwU+FiW7dEQdQ+IhUpDGJQbfvep4YxMMsbGzH2P7jdBnqv3RI/Xk/c 2ZHQ== 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 l74si1153861pfb.386.2017.07.06.02.50.38; Thu, 06 Jul 2017 02:50:38 -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 S1752513AbdGFJug (ORCPT + 25 others); Thu, 6 Jul 2017 05:50:36 -0400 Received: from foss.arm.com ([217.140.101.70]:36132 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752399AbdGFJuc (ORCPT ); Thu, 6 Jul 2017 05:50:32 -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 0AE391650; Thu, 6 Jul 2017 02:50:27 -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 0B4473F3E1; Thu, 6 Jul 2017 02:50:24 -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" Subject: [PATCH v2 05/10] arm: wire frequency-invariant accounting support up to the task scheduler Date: Thu, 6 Jul 2017 10:49:43 +0100 Message-Id: <20170706094948.8779-6-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170706094948.8779-1-dietmar.eggemann@arm.com> References: <20170706094948.8779-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 | 3 +++ 1 file changed, 3 insertions(+) -- 2.11.0 Reviewed-by: Viresh Kumar diff --git a/arch/arm/include/asm/topology.h b/arch/arm/include/asm/topology.h index ca05d1b90411..57aebfa03e24 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); /* Subscribe for input data for frequency-invariant load-tracking */ #define arch_set_freq_scale topology_set_freq_scale +/* 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 6 09:49:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 107099 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1881941qge; Thu, 6 Jul 2017 02:50:59 -0700 (PDT) X-Received: by 10.84.167.74 with SMTP id j10mr26944169plg.41.1499334659374; Thu, 06 Jul 2017 02:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499334659; cv=none; d=google.com; s=arc-20160816; b=mQo8jbLox3oyyDx2r5f2737/3vP3Pyi79S2qQTjNYg+sWQ1rCckf/P+MgVF89c6A+B iTSzD11vCLiF0oCW7SboWIiQZ4/dGgxPdD/V2nLHQhFJ+OWEhxDujIVy2xzQR41neRc8 hT5sVgZj50MGPOSAM60NmDDXxa0Bm+TPQ3P908NJXGbo9BnWem6trj2vIm4i7mGnFgvK 19p7z9MGJAP1QH2cKBumbhnyYMxra06Piu4ffHnNZVyEAEiCRN7uWA7cR5Hdu0ivSd9Y Y6XnlzzXcSlBFAH39wJnoonRtiVlaYVgIyAl+g032PbuVwQeT34nMDZ4dcj+yau752do s9yw== 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=QSnJ/tSwMzYkQ+O4gyu5ZWovjVOw8/T2bGy904UKrnU=; b=fHZ1JPSM/9lUVOUH/JMprqo4GNYCYxd3knw3BnCiYiwpUjsljKixS0oqgKGy39e201 8AbOsAII8Za/Ge5eL+2Uf6FnFRQHIxLA5MFeBrLc7qRK68tUEdZEbJb/8WHVCQNpAoDZ 9PF2mP/g0oaDeDpg40axvfS5LNXqEnwIn8BlE/WUt0KJXd1dY+M0MTNn6lsQLoXVcVLp eXMi2sOXiIeO+1OUYhTmCzLzqyE02gPAQFKfE+6ePpqK9VUby8d8vNLP9WrjOD67Dms5 5IQU4nehmPtcu0b9refkh1iX4YTKgdSXpMgv+4HwiNw77wHFsBbhwKQC0AProvJ2Bsyu 3DZg== 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 d20si1351456plj.429.2017.07.06.02.50.59; Thu, 06 Jul 2017 02:50: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 S1752526AbdGFJuq (ORCPT + 25 others); Thu, 6 Jul 2017 05:50:46 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:36138 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752010AbdGFJuo (ORCPT ); Thu, 6 Jul 2017 05:50:44 -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 4003D165D; Thu, 6 Jul 2017 02:50: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 45EF63F3E1; Thu, 6 Jul 2017 02:50: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 , Russell King , Catalin Marinas , Will Deacon , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" Subject: [PATCH v2 06/10] arm: wire cpu-invariant accounting support up to the task scheduler Date: Thu, 6 Jul 2017 10:49:44 +0100 Message-Id: <20170706094948.8779-7-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170706094948.8779-1-dietmar.eggemann@arm.com> References: <20170706094948.8779-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 57aebfa03e24..26d491c65955 100644 --- a/arch/arm/include/asm/topology.h +++ b/arch/arm/include/asm/topology.h @@ -32,6 +32,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 6 09:49:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 107103 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1882759qge; Thu, 6 Jul 2017 02:52:00 -0700 (PDT) X-Received: by 10.99.56.82 with SMTP id h18mr25456229pgn.52.1499334720810; Thu, 06 Jul 2017 02:52:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499334720; cv=none; d=google.com; s=arc-20160816; b=SKOMRPgJWWnH12z1RA3QK9M9CCgApX5GwKcviCrlnSOnznC2UWodLhfXDSp7kjr3cW LTCpUm2xF9jT7Xkflg2u0b9H3+2LvsBepcfI64cR+zycfeW558cgnMWj0liAzD9rQ63v hD0nErvKBY/yUbIfrjlg+/h6wlZPq+Vc+kqq9GKDBYuq8XY3Ehah5oJcARYeDL34ZyIc B5bI1rfFW+0OtSjN5CbxP8whvY4mD12wPVbVMsiiSdbPfsOZ4MQlDcGKRB36v+uIW2OY qVyBSBh1hGcrzEeA5asSX0FZzomEEDQsUnh7ER1gw5ACYC3HMH4z6Za5wUyy35i8rIxz bgcA== 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=UGj4VNoMuA0gAqJGLsZ5k9seYE29/faBuegz7os5Zg0=; b=qCZq8SJUXTO0oFDsSAHEJPBI5Xa4StUImszwp7bO1qifw5e8PVUUx57UGR9CIKYrPM jR/6rInZWpfyqd2p3K40ZJjBw7RfyasVX5wvUvcNL7AFOzSHHEoj4AkW2b/le8LU8orl CQ+hqqOCwc19j36u3367clWsfpBvi8or28iG+nh24INk1tzQY1qMeOO1IKDQbts33X92 9axqp7xWatCjDZCzvKQ34CiChX6p0vZVCAnCuz+7wvA1dH3UUGcFxxOqQjyL85XlF2od 3RY7C6NmwAlKxBCwNQ76ZH8KxDE1uFcCTgaMS874D0IG5Q6OlTvxWnOmZwSJ7lJtPAQQ crsA== 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 o81si1160949pfi.131.2017.07.06.02.52.00; Thu, 06 Jul 2017 02:52: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 S1752466AbdGFJue (ORCPT + 25 others); Thu, 6 Jul 2017 05:50:34 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:36160 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752257AbdGFJuc (ORCPT ); Thu, 6 Jul 2017 05:50:32 -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 7DBF61684; Thu, 6 Jul 2017 02:50:31 -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 7C3D63F3E1; Thu, 6 Jul 2017 02:50:29 -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" Subject: [PATCH v2 07/10] arm64: wire cpufreq input data for frequency-invariant accounting up to the arch Date: Thu, 6 Jul 2017 10:49:45 +0100 Message-Id: <20170706094948.8779-8-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170706094948.8779-1-dietmar.eggemann@arm.com> References: <20170706094948.8779-1-dietmar.eggemann@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Define arch_set_freq_scale to be the arch_topology "driver" function topology_set_freq_scale() to let FIE work correctly. Cc: Catalin Marinas Cc: Will Deacon Cc: Juri Lelli Signed-off-by: Dietmar Eggemann --- arch/arm64/include/asm/topology.h | 5 +++++ arch/arm64/kernel/topology.c | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) -- 2.11.0 Reviewed-by: Viresh Kumar diff --git a/arch/arm64/include/asm/topology.h b/arch/arm64/include/asm/topology.h index 8b57339823e9..d9cbb289e295 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 + +/* Subscribe for input data for frequency-invariant load-tracking */ +#define arch_set_freq_scale topology_set_freq_scale + #include #endif /* _ASM_ARM_TOPOLOGY_H */ diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c index 79244c75eaec..6cbb6315e493 100644 --- a/arch/arm64/kernel/topology.c +++ b/arch/arm64/kernel/topology.c @@ -11,7 +11,6 @@ * for more details. */ -#include #include #include #include From patchwork Thu Jul 6 09:49:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 107101 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1881952qge; Thu, 6 Jul 2017 02:51:00 -0700 (PDT) X-Received: by 10.101.85.206 with SMTP id k14mr24883509pgs.153.1499334660192; Thu, 06 Jul 2017 02:51:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499334660; cv=none; d=google.com; s=arc-20160816; b=fU7thY00xef0UFMYEI6e9NNwKCnPLznjvR0rUiiWQv8u8w8RSNwW9kSKJtwA/Xhara 3fmaZrG3Zjz12BXPNKQecYziLV3dkr9mr5dhvlqZW5J6puTyuOj5ct5GEYaLWM8zB/rN msa7SKwJSxvba4RlcjYoX94XdESFxwCxh0qZJVCN2Z8vZ6HAIlr/drdabD4ADiGJlmpg MkxNQBR0Iuy3pSyff3lhl7yBVg37evteJQTAkmFxPPHWQyeneIhNKQZb39ml9uM6dMKH 04Q3fWkDBlJmnNURwvnf6sSxDbnVcvg42mgwfV0tpBptzzpE609Mm/S6Op+40JKlVhEI ygsQ== 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=zSEsqNXwM7Am/xqnSLjsqTVx7fNoA6WhhI4tr7m/HwI=; b=nbdaJNzc6AHoocT9c3sVWzcWU2JMBdH41k1NHQmA5tTkYJQIM+CJgdznywMbB0QNqh K6UKM200c/T1qZ2NzgPIrkDdu1poLEWboeFOdKmgDEuv5d/NIA9Kh+AJ51knunm84aG1 vp5PEFTvCGwbJaJEYrQNmGM2+pQOaJp0HjR8E2KuBrgWy8EwaG7kRbTGDAiZdcKyWhKP d92DFRgI/Lbbx3+b1I6nhnQY2VNy4TVa3dtllcxVBHgCMKxGRMJip8mrd6/AL4OJMvni +nlpBZhtP/zK7AEbO8ZjuRezFlqFb3eNeYl8AML2CggCWSUC2foD04wvSYH0vxhC+Sok g0WA== 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 d20si1351456plj.429.2017.07.06.02.50.59; Thu, 06 Jul 2017 02:51: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 S1752590AbdGFJuu (ORCPT + 25 others); Thu, 6 Jul 2017 05:50:50 -0400 Received: from foss.arm.com ([217.140.101.70]:36166 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752516AbdGFJus (ORCPT ); Thu, 6 Jul 2017 05:50:48 -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 B8B0D168F; Thu, 6 Jul 2017 02:50: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 B94B33F3E1; Thu, 6 Jul 2017 02:50: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 , Russell King , Catalin Marinas , Will Deacon , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" Subject: [PATCH v2 08/10] arm64: wire frequency-invariant accounting support up to the task scheduler Date: Thu, 6 Jul 2017 10:49:46 +0100 Message-Id: <20170706094948.8779-9-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170706094948.8779-1-dietmar.eggemann@arm.com> References: <20170706094948.8779-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 | 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 d9cbb289e295..4fd598b432e6 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); /* Subscribe for input data for frequency-invariant load-tracking */ #define arch_set_freq_scale topology_set_freq_scale +/* 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 6 09:49:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 107100 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1881947qge; Thu, 6 Jul 2017 02:51:00 -0700 (PDT) X-Received: by 10.84.133.38 with SMTP id 35mr15357702plf.141.1499334659799; Thu, 06 Jul 2017 02:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499334659; cv=none; d=google.com; s=arc-20160816; b=xxNENfJKCjw9SICKDntxTJiBuOJIwffA82NT0KsiNEddOlxGwydGpSJAfa1pOJ0cMv g+vREEYNZ6MQ4e8NNjw3U5sX9rSwbVy9Yw+nZoV0gJiae/a/YnEsUY7VZNLMU8EenlEE yAPB3/g9KUp98q0oYj4kwrx1JvJxnNTiDTKKcvn/QC3n6/FtPtOln45exmQZ0rSwDkp8 qAtQbgC9jrMRqu/s6TazSan7Quexczubtqn8+D/7GMPBIHa9hyF4W/R7pLV14xb3ISzn nLX35l0W+9WS2G8qC1+A9EJe2o/JP7BYjs8Rv12LieQxGYwQb9YnQWIKqsBjIS575HPr oPSA== 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=8AbUIjn6F3RdoHkrcW17TDvF5bAsF5zej+829sVGxn0=; b=OgVQwe+KCuqrTPzs9M4/79vR8UnExIjelK80wbsSXTW2I8jXJDV/DAY/fyP170z5qM 5SEEZgv3zvYWqIFxQx5nOfd5JcIwifTd25FeTS3F76h5X0Q8u+XPAgJP7H0nwtx7a3WC aTuStVsAagJaj6vUIX8LqgSSbb9Lqfx0EJqqkt+IV5EGwKUBQBJxVTUbYrTNWLoR6NH9 0IMNTQLgbTYnjr0QgOrP9UXSHY/CP40pGDmF6LbUk93vZ/8TeeciThP/zbtN6phmvOEn 9ONwQLGmDmkCIjZqXK03FYU7K4jZ4yMOJhZNcvNQov5+i6iHb3ZaISh22df6jj0EyCFz 42wg== 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 d20si1351456plj.429.2017.07.06.02.50.59; Thu, 06 Jul 2017 02:50: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 S1752551AbdGFJus (ORCPT + 25 others); Thu, 6 Jul 2017 05:50:48 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:36184 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752516AbdGFJuq (ORCPT ); Thu, 6 Jul 2017 05:50:46 -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 0037716EA; Thu, 6 Jul 2017 02:50: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 0061C3F3E1; Thu, 6 Jul 2017 02:50:33 -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" Subject: [PATCH v2 09/10] arm64: wire cpu-invariant accounting support up to the task scheduler Date: Thu, 6 Jul 2017 10:49:47 +0100 Message-Id: <20170706094948.8779-10-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170706094948.8779-1-dietmar.eggemann@arm.com> References: <20170706094948.8779-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 Reviewed-by: Viresh Kumar diff --git a/arch/arm64/include/asm/topology.h b/arch/arm64/include/asm/topology.h index 4fd598b432e6..0dc81860cc0d 100644 --- a/arch/arm64/include/asm/topology.h +++ b/arch/arm64/include/asm/topology.h @@ -40,6 +40,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 */