From patchwork Tue Sep 26 16:41: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: 114268 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4042652qgf; Tue, 26 Sep 2017 09:42:28 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDraR+9ob50cYm06MNxwIqeODuL6eAs24YZPoC3qwpvEH+aIttCAY3mh/ktdCeiXBDn37Ez X-Received: by 10.84.172.131 with SMTP id n3mr11415078plb.408.1506444148312; Tue, 26 Sep 2017 09:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506444148; cv=none; d=google.com; s=arc-20160816; b=xmH8he4z8MN9Vy4clxzBXxgfAZ437ptYMZOCcGofUUwI3U3xBkPFHBpM2GVkrQ0Yzx 6amSb0koenMLfE1KUQjcsv+ZN7XlnycdIXhDsToy0kA5hWA+UVHFK/GLw99DmURcmM2p zAP9CEXxSItS7mhAzCMI9HLHR26VslsJfhoyArnmi5jM5EbsJB/5zM+OA6GGkXg92rlE 5zFRGHthCee3jAN/wb3mLowZnYRKMrGJTlDTmFxuBMNvg77X+rWaZ7Pp3QkapyyzgNo7 5N2pOn8MQXE1Zs5aiuXDfhArxWDUE098i8R3bir/nrqUDtCL4qTLv1W4+nFPzeuFuziU WpcQ== 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=CMcSefjltR29SCcLQLQ82/r45hHUlv/E9HvlEj9Xj3o=; b=I/ShJ7Iqt6AhgcpXnEAzhrbtkG6RKPxmPS7Y0tfsBILwA2FIS4+CtPjP0BPKSZaHMK SiwYLbEUz13VkuesgRjlYm1UkNU4fbjorYJkE2L8G+usZy4a1U095teNc/tLBuC8q70N LM/FfdbqD1IdXxfUrMJlKsm3aWebZ2s7edsMaLEZOENfkQgF+yMphLQdi1cTuHmQU3bx aj9ZBUYiEnmvU9SrKXClDAEQQ/g58fQSPSPwEKe6sxqYnwxz4j+lSspM1cQcfUH7gVNr hoV8fmdDvEbNycvSzdy/grz1NMLzhIV4QC51Gt2hNAGdRsVe8sAY6QRHq7TqEWKVBpMD 228Q== 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 a1si6139536pld.153.2017.09.26.09.42.28; Tue, 26 Sep 2017 09:42:28 -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 S1030631AbdIZQmZ (ORCPT + 26 others); Tue, 26 Sep 2017 12:42:25 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:35998 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969099AbdIZQmX (ORCPT ); Tue, 26 Sep 2017 12:42:23 -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 770FE15A2; Tue, 26 Sep 2017 09:42:23 -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 1E3A03F483; Tue, 26 Sep 2017 09:42: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" , Sudeep Holla Subject: [PATCH v5 01/10] drivers base/arch_topology: free cpumask cpus_to_visit Date: Tue, 26 Sep 2017 17:41:06 +0100 Message-Id: <20170926164115.32367-2-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170926164115.32367-1-dietmar.eggemann@arm.com> References: <20170926164115.32367-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 41be9ff7d70a..e9bb368f32b3 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -212,6 +212,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 @@ -227,8 +229,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); @@ -236,6 +243,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 Tue Sep 26 16:41:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 114277 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4044196qgf; Tue, 26 Sep 2017 09:44:18 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAblX9L9GIRCpqyvcboNTz6elRczRB86ltxfKtQ+YLKNngkMfY+YWzrtiiTtYjSggc0yaQG X-Received: by 10.99.5.204 with SMTP id 195mr11582604pgf.231.1506444257961; Tue, 26 Sep 2017 09:44:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506444257; cv=none; d=google.com; s=arc-20160816; b=SkRrAxECqx112Le088mf7A8Q7UtJqJCENh7MBCpiBucCdAzWTlncLjw+img4Yjm1QK h8kCaIEoCZvG2EUEYHiHKyWi4BjgiUALJXKUz0x7BSvCsvta5CTNt4agJiLasxN90j3A /0G7U+/LYvrcElJPmBbRShue6SqZdahbaH5IuggiP/0Vz070gnsbHCeIwYqlNrKDnw3j GcNO119hdr845xlWdRyFu2s237EewgGQSgm5It1Ww6ZvdvNMILV3EleHOxzohugCrMZA Yz5crL+9WdNueAGod0y/Z4/rvFQJCqssWzsc/CHzk1FMpFVojGUv8EwiDbGdh7+tFrEb hl8g== 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=xBqk6gi4WAPYwqHE1QvfMHhzkC9rnQfXbCSDUdmrnzQ=; b=Xm8kLt7+T2P72Edjaj3FnW4/O7KIqOwWLd9C9UQNPaM3kB799s7InKew6RtUKK/l5Z Kalo4xuspFvwgb8ZCGeNILQJyDdCZO0QD60dmd1dBdjanqR+LOlce8TN/JVnnUWAhYxo WMEwaK6FxEEd7vHugLUdVz5s+8/D/zG8BSCsiEQTctljQRiOtZGj9lTJDM5PS7FChoD1 +cdZIwsem2yF1WoPqXPXEd1PDVRNt4e4yLFbTrkdSU7X9XDY14C2DOrqWihrFQDOYA12 jqXEoq+q76UusO5+y5vK25fCegBiA60Zlc3VDAFnc5tJrsYIeL+SH0rTttc7hLQWbQZs /gwg== 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 z16si5739649pll.345.2017.09.26.09.44.17; Tue, 26 Sep 2017 09:44:17 -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 S1030694AbdIZQoO (ORCPT + 26 others); Tue, 26 Sep 2017 12:44:14 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:36030 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030648AbdIZQm3 (ORCPT ); Tue, 26 Sep 2017 12:42: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 B1CDD164F; Tue, 26 Sep 2017 09:42:28 -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 58EF63F483; Tue, 26 Sep 2017 09:42:26 -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 v5 03/10] cpufreq: arm_big_little: invoke frequency-invariance setter function Date: Tue, 26 Sep 2017 17:41:08 +0100 Message-Id: <20170926164115.32367-4-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170926164115.32367-1-dietmar.eggemann@arm.com> References: <20170926164115.32367-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 17504129fd77..0c41ab3b16eb 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 Tue Sep 26 16:41: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: 114270 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4042757qgf; Tue, 26 Sep 2017 09:42:37 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAUMu/bmAvssZrDxgv8qK0dgpHghH5KtJaPNBu6crabfksOmudv3NpAspMHXUGrJp8U/ulX X-Received: by 10.101.73.129 with SMTP id r1mr11707009pgs.411.1506444157240; Tue, 26 Sep 2017 09:42:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506444157; cv=none; d=google.com; s=arc-20160816; b=lqXy8rh6lOMHdjUHeT2AUDDsj5+qHycQTccroNzMQehj2fN7t8L11qdbq7WTCutX0z QcTKTwq4wHibQBliRfGwve8H4gQFTKgChHO2+osGEFfcuqSRbNnq3u0X58vUWMLvLyrW EmRU3+nAf1p0ulrTONV5VFmg1r994yVDsE4SQqD9NwnU46pADHrXKJOu+ggRLGUr5y1n CjQpxRv9pM7ixqH9OVqWfywZSwOKA2Sy6H/TpulNFjxUtVGhIdvgfBeW4Hs6gXko2R54 8QlbcS2LYYYVfalqYul2tm3G/On1c5KWXngcpuxy+4B+FuNfKHhKjfTMrw/uilrwTHk+ xRzg== 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=8fpD/HhKupRtXdhiM4QfEiCZ3UYTDG1N4BRS/FsrRo0=; b=jWo/y2FYlHS/a1tT75s4ua4O1jpusdNMyCtODCaOSAbmzUlo5wmbArlOwUR+iwZhXo nq069Nx/l8wV1u8bzLLZg4UeBBFyoStzNAhwZSiB0hINB3Sjy9FP88lRUHaDJUL59qGq 5Stlc17A6LLLHlenNIuSNw3Ub68YLwtUaTSsWBu25x5p5v27LQmPFDqaRB2rOLvTxItv GpTUWs1JjsbS22RblhVQzal18JdohBkWR+cmfBwMygzBqVbxJ22bo3w3gUr12d5JVnS1 /HeYEkuqsYIWQ0VBrxGmx5/2RGnky72XH+51mU0vquQxg5UhkPAMCS9we3PGE2YnkF0a 1u+g== 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 b5si5511116pgu.734.2017.09.26.09.42.36; Tue, 26 Sep 2017 09:42:37 -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 S1030748AbdIZQmf (ORCPT + 26 others); Tue, 26 Sep 2017 12:42:35 -0400 Received: from foss.arm.com ([217.140.101.70]:36034 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030638AbdIZQmb (ORCPT ); Tue, 26 Sep 2017 12:42:31 -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 5E00F165D; Tue, 26 Sep 2017 09:42: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 F04373F483; Tue, 26 Sep 2017 09:42:28 -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 v5 04/10] cpufreq: dt: invoke frequency-invariance setter function Date: Tue, 26 Sep 2017 17:41:09 +0100 Message-Id: <20170926164115.32367-5-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170926164115.32367-1-dietmar.eggemann@arm.com> References: <20170926164115.32367-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 d83ab94d041a..545946ad0752 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 Tue Sep 26 16:41: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: 114276 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4043816qgf; Tue, 26 Sep 2017 09:43:52 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCkYmsQIDdtjTmIYZrV/2IwfGXCYRxPM1/htbKT0caVbprOFu9Gwpyk0HhDTVGx4+kvd3Pt X-Received: by 10.99.120.3 with SMTP id t3mr3276981pgc.388.1506444231903; Tue, 26 Sep 2017 09:43:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506444231; cv=none; d=google.com; s=arc-20160816; b=yVXeD6SYL1qSKOdGke8F3Ap0OLipEIBvBZC4SOTK9eaplMvNDW0YZosX8XztWn3/sw 9TKAjRMFXcVFiuh9/lBIy9/a/5txPUj1/+V3deTAN7a0DjpUKc1Uj02DcumeZT0ED8bg GkGpC10X4q2/QxLOaLT5u4xpktS3ObFFAynMKzed/KjwF+I8OCUjadKfPxBIBkQwdIkG 8bM3ppQk01UkfY7uj00AeZ+OcskODGBVYnQWFL0YOh1JlHhRbJioktgA7n7la7JAs21a NDSf08fX14VOdEMZYpuWNLK6gmPLK6qhwe+xFEKIoyv2Fh7z0cj5a7WHpIVVBzBMl7iE G1UQ== 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=e7a2aK43GRbcVZ838fOTcdl3DfSym0QuriHTtMrijVo=; b=TLiC7VsYU0UPG2fZAd+epJbbSQEwt37OvjmIwDrQ5g2FLWibHUwWyp4jMmvXzSm4a6 XZIRnF8N+IYNMKbdAnFX3mqzgWYzpaciJ2GHRJs6k4OwRe8kbx/Db9HyokESo/zfe5S2 ny2k6pDgWo98nGchwtqPJrF7SY21wjUHLjif9a9hoC+ojydH/0LnvaLqkGQXnUiQHy16 ju/BsbRIZ8D9OJ/FPA+jLPot3m0lZhBSTzlvz2KBF/Lyi5TZKvif4v3h70WerGmPHY82 og9Mh9FiqN25AIx7hV2MHv6NQipxIZ8oTNEFVA0IrQgPS1m1p/PiIFrzEcnM6yDOEYPC O++w== 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 z79si4148407pfi.486.2017.09.26.09.43.51; Tue, 26 Sep 2017 09:43: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 S1030845AbdIZQnt (ORCPT + 26 others); Tue, 26 Sep 2017 12:43:49 -0400 Received: from foss.arm.com ([217.140.101.70]:36054 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030694AbdIZQme (ORCPT ); Tue, 26 Sep 2017 12:42: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 0130E1684; Tue, 26 Sep 2017 09:42:34 -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 9C9193F483; Tue, 26 Sep 2017 09:42: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" , Sudeep Holla Subject: [PATCH v5 05/10] drivers base/arch_topology: provide frequency-invariant accounting support Date: Tue, 26 Sep 2017 17:41:10 +0100 Message-Id: <20170926164115.32367-6-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170926164115.32367-1-dietmar.eggemann@arm.com> References: <20170926164115.32367-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 | 9 +++++++++ 2 files changed, 23 insertions(+) -- 2.11.0 diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index e9bb368f32b3..416ec2f5211d 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 716ce587247e..f6e490312e4d 100644 --- a/include/linux/arch_topology.h +++ b/include/linux/arch_topology.h @@ -5,6 +5,7 @@ #define _LINUX_ARCH_TOPOLOGY_H_ #include +#include void topology_normalize_cpu_scale(void); @@ -16,4 +17,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 Tue Sep 26 16:41: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: 114275 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4043516qgf; Tue, 26 Sep 2017 09:43:30 -0700 (PDT) X-Google-Smtp-Source: AOwi7QA1v5cDeg6BwDPex/MHiUon3BYf2oYeKPPPzXTxn3rjc+PF+AYpq4btrr7eqyJdLq79F2Fv X-Received: by 10.84.177.36 with SMTP id w33mr11243792plb.427.1506444210629; Tue, 26 Sep 2017 09:43:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506444210; cv=none; d=google.com; s=arc-20160816; b=A0Spgtt+WUdkNQ7lFxeVcLQcX/WTbe6GtKQpAycA+jbquIJU/C9VcYaEgaSCv5ibD4 E+gRpIaUV6lomqkxB3iENQ6cjTmcfSwFDqsZQkyv3pkwTjm8mVt1MqTxTGuWmsREWBfp mRCnUyd2F1l+cmTrUKdRnHrYO5ZL4R3vQotyopyjeiPO9EBoy5WmxYxLN0Z15GKBF6Yz a2uTCTITUqS+eD91J+vaIzdRpD2Suaq9OnSRw16qImrzXb0hD4Fnva1BD71mux6czOYE t1pvIAs6qxgXli/3xJPE1Jwb96voYARVIo8b6zOVhe/u5EVs7fsMxj9R4PMrG2Jno/sU WhZg== 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=mLSrS3/jnj6laBREH83TboskYsPSMSecv14SeOI8hvm6mffc8rMEKUTLN+kvJCSCmP uS4zMAogg+0nQgm6x6AlHoyZu0BjBp3Ygso0R21ZCIfLjZLD78WjAgGAHbQSY02tIW77 9PBcrPRlg2wLz6hpuN5Pl7+4Ok+fdHcW6nSxiwc/azFbGwkTdS8rKHUuAXF6Io76LVS5 MVYntiEPyS5DA1YSg4nlZpmC/n1lQWDCoggcXSem5wwDGy7rkKbz7tpNrk7Zj/piqSde KNCa+LFzXbGc7O7JVJT42OOids5EupzBqHrkFgOU5OZi4FTCbUQ6xGCJpULpnFGgK0J/ AuZw== 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 u75si5925205pfj.286.2017.09.26.09.43.30; Tue, 26 Sep 2017 09:43: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 S1031510AbdIZQn2 (ORCPT + 26 others); Tue, 26 Sep 2017 12:43:28 -0400 Received: from foss.arm.com ([217.140.101.70]:36082 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030759AbdIZQmj (ORCPT ); Tue, 26 Sep 2017 12:42:39 -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 3C0081688; Tue, 26 Sep 2017 09:42: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 D75503F483; Tue, 26 Sep 2017 09:42: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 , Russell King , Catalin Marinas , Will Deacon , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v5 07/10] arm: wire frequency-invariant accounting support up to the task scheduler Date: Tue, 26 Sep 2017 17:41:12 +0100 Message-Id: <20170926164115.32367-8-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170926164115.32367-1-dietmar.eggemann@arm.com> References: <20170926164115.32367-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 Tue Sep 26 16:41:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 114274 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4043300qgf; Tue, 26 Sep 2017 09:43:14 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCZC62ZKLKEcSp7HZx3A7YNtQDWt/JzIobbyJ+rm0l0U6P4aMk03nlXDKEi/neu52MgwT4W X-Received: by 10.99.1.81 with SMTP id 78mr11233614pgb.99.1506444194478; Tue, 26 Sep 2017 09:43:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506444194; cv=none; d=google.com; s=arc-20160816; b=plFlEh44HG6/mmebWkFHN3IVez1ZyC4qYZuXvmFtrfsvQWq3W8OvM0NtyVLT3/qqAW bR1802Ji4bSZYS67ZVIrg0F6CaRbv4vA08EvPKxMgPhAProuS+SgqVlwQQ1/2Kq0bNDb fAoBKBq/Z6+GhCTnkL8SlekjDVLzdO+DKAFMrZ2NDgNjQrnpwDnUQbW29r0/qw8drNke yjRn18AP+Y0ah9xhxPAb8/uGkf82phlSt3stoy7zfOblO9EJ33ksJoTRet8Krc1u+6et 8q2B1grk9UIjsjv5eSjNF4kjouzrCf4pX7T3ObHDsDnc697HIqxZL1rCGF73d1rcnPO1 cWXg== 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=nCr9J90upXbee+JCUv5Zmvv+OWBcT6kUmo/KmHuOaiw=; b=OEk/EVYhKcy+i+kndoV/JFUbXgPPuoIX6J055XvfFI6BW95yo2GOhQNIDqkFARLx+t ln7qQktIkKJSLGvIohIfwrWoQDRypVBsdJ7YtpfCTXtmIgzKiRCdEmCW1i2/cBKt9buy nHgHYR/lUbhwKfkq/34JqrZtMt4edHYoy2K7JCMCbT/m4ZDltJ8I0sAhUYE899zCNrjM Tz410i13d1Uyi+YpzNfXodHI2Eu8TMmmfXya8/ZjN6MUXBWL632uycp97jkDGlOPKAA+ 8XiRfszbK6+RmMFvlp4/eNXq5T5mMb6bL9Q7KMsnjFcbsLN01Pd9ZWPGhBaGO0q8tkoI w0IQ== 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 p20si5859161pfk.425.2017.09.26.09.43.14; Tue, 26 Sep 2017 09:43:14 -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 S1031378AbdIZQmp (ORCPT + 26 others); Tue, 26 Sep 2017 12:42:45 -0400 Received: from foss.arm.com ([217.140.101.70]:36088 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030638AbdIZQmm (ORCPT ); Tue, 26 Sep 2017 12:42: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 D3824168F; Tue, 26 Sep 2017 09:42:41 -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 7A7513F483; Tue, 26 Sep 2017 09:42: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 v5 08/10] arm: wire cpu-invariant accounting support up to the task scheduler Date: Tue, 26 Sep 2017 17:41:13 +0100 Message-Id: <20170926164115.32367-9-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170926164115.32367-1-dietmar.eggemann@arm.com> References: <20170926164115.32367-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 Acked-by: Russell King 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 Tue Sep 26 16:41:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 114272 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4042926qgf; Tue, 26 Sep 2017 09:42:50 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAfHUITwyBjhiqvsxDS0FlSIedUr3/SGhpw0I8IiP1RUFQ+LEcgHtE8y+ogZ0fUdTfu6eje X-Received: by 10.98.135.194 with SMTP id i185mr11226008pfe.330.1506444170333; Tue, 26 Sep 2017 09:42:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506444170; cv=none; d=google.com; s=arc-20160816; b=OyL+ce2vGWP81R4da2+AITzdyjEGKmc0Kzh7RSrwLJR7wXb6suRXor0fMpeehBoAEO Va5SJ0o3kHX1AFqfp08xnYIZ/ACcNHxyMBskUIr9tbajbLAphhZCuHkDFW9uVvFUsxJL gleFmKSygrTdevKN7HftaI4N/GgiD5VLeq3IuOcv3s807G5qnQgEXyM0IgDaa03Tce6Q s1EVN5Ps4awAkB6wkzE+6abo+GiJ6SIvRchRKJ+eW88g9UVPbqdetxnPBBR55vheEEdE 0jV9+5C+cGNbM0Opg2LII4Lm74lIXqDM6KKG6g8hJybUgazxaSPzQw9HSKqM9/aEPTCe i35w== 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=SQcpHIxU3hnV5lWqeMWnl+O+DeT7cA7hDLm6TegvQ2MHIxkCwhlOfRO4MeOpnggsov FTajBsl4spjWiR8r7jKfccq+SOReCLk+No4GPYwfJf4ZBI+GDzwYfgSD4oGmUYYIBVJ7 oOjZRdTkgOzys5ITDNxCAOVuQLss018i12qX/n+TARHrRdmOKnM0Znimx7dBKWcNxN0k DRhr4h+kzjWp0zVw4v/txSrS6dvlwNlrTG3yrdAUTzIeYZxVtU0VGKuI8LBhZm0BUZhO eSzv6XfRPDv6cEHwAfZduKbPh8fLb48xNj20gCqC27QQfBSxtdOH6hXSGc9Ht4V6+eMD MNEQ== 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 u12si5488170plz.696.2017.09.26.09.42.50; Tue, 26 Sep 2017 09:42:50 -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 S1031485AbdIZQmr (ORCPT + 26 others); Tue, 26 Sep 2017 12:42:47 -0400 Received: from foss.arm.com ([217.140.101.70]:36106 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030795AbdIZQmo (ORCPT ); Tue, 26 Sep 2017 12:42: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 76F11169E; Tue, 26 Sep 2017 09:42: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 1E1533F483; Tue, 26 Sep 2017 09:42:41 -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 v5 09/10] arm64: wire frequency-invariant accounting support up to the task scheduler Date: Tue, 26 Sep 2017 17:41:14 +0100 Message-Id: <20170926164115.32367-10-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170926164115.32367-1-dietmar.eggemann@arm.com> References: <20170926164115.32367-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 Tue Sep 26 16:41:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 114273 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4042974qgf; Tue, 26 Sep 2017 09:42:53 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBeHc+ZtHt0tDYnlq+osPaMsLZR0PUPzc9DkteNqhb5P8ALypCy5MPkTIUHo9jG60JIT3I6 X-Received: by 10.98.144.142 with SMTP id q14mr11241072pfk.303.1506444173865; Tue, 26 Sep 2017 09:42:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506444173; cv=none; d=google.com; s=arc-20160816; b=aDRKmT+eWhJBzoOtz6eyCgwGbpY4Ejmlqe0hy7RGD8NxmcWpRW7T5BYyHwdREtxHX/ TjMdqrdM4LcX2e3EQDaLi/amsmjBoIy7s9gb1MQvuGG9dYsMWm7FNgTb+k9nqdZMdOma sibaudXzX/QGPfKHOJj0hmpor/m7dFitVybQeXWOXgYySfouolCtL+XTJcql1F29aBVV Xe8LBe1FFBhiGZCkn5N3OEztMIrvwKmQpls0yLZXRV9WdSa4+mSilxpJVuFeF6kATEre nji28WmFuNgrXZe7fxfTQj4YIGgPvj4O8GwguHh5Yj9G/VwWA0SDcPQMNnT/rLglUkE2 KSIA== 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=LQYJPMtgnqdsPOcN7btg4kY8qU5W9Zy5XFLQvELF2FrEn/TwN5Qq9SiQS/N9oazqpW JMgkwdf4BR+EkFku2EGWtvadkUUE544Ma0TjruCKgYsMcfG7P1cuT/6wu1g41XDQQxrG Bg1W15TDduEaQa7c+c57RluABb7zBpr7mgLajG9LBhz7VwDEZlmfEsvjhok1RDl5apNs Wpn2Vzw0vBrcDflinNO5f87vtoPiNyBHZ+M4ZqPZ2tBYyMrl8ZDJVi2NK/11dRF1wijU iVh4EV0OGy9Vu+5gLQebJBMOvU/29QjQCmM6RBSyKgbIq+D4JrAdLtdfNw9hMXOgEXeO eWFQ== 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 a62si5884697pfc.433.2017.09.26.09.42.53; Tue, 26 Sep 2017 09:42:53 -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 S1031500AbdIZQmv (ORCPT + 26 others); Tue, 26 Sep 2017 12:42:51 -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 S1031486AbdIZQmr (ORCPT ); Tue, 26 Sep 2017 12:42: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 1A13480D; Tue, 26 Sep 2017 09:42: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 B56553F483; Tue, 26 Sep 2017 09:42: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 v5 10/10] arm64: wire cpu-invariant accounting support up to the task scheduler Date: Tue, 26 Sep 2017 17:41:15 +0100 Message-Id: <20170926164115.32367-11-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170926164115.32367-1-dietmar.eggemann@arm.com> References: <20170926164115.32367-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 */