From patchwork Thu Oct 12 14:00:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 115631 Delivered-To: patch@linaro.org Received: by 10.80.163.170 with SMTP id s39csp1790209edb; Thu, 12 Oct 2017 07:01:01 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDmhfpdSoKchCquzee48y3oEvLdESKqIx1XRKjsTjMIadfHEBvct93Ltx8mVFkxadag9VZM X-Received: by 10.101.83.3 with SMTP id m3mr315760pgq.398.1507816861036; Thu, 12 Oct 2017 07:01:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507816861; cv=none; d=google.com; s=arc-20160816; b=SsZ9NgqjukB6JtYg3iTN/WgpYVUBaoiT+4/WFk0KCD+z8IzgBJxwp+e9N+DzkFQB55 UitNEyujnGYmZe4WI5PaNAMjNZYK93RB0k889YEl8/xScry7tOyG12t7mWrDDOVI5db0 jNPZnPWl9SoDP0YpqR86buqN8Jj09vKdDC8WTNW5XACJE6pHzpP2SqIGSmHCKbwrceFc sPZ1DZzopvz/KAMazjt3Z5cXQ8Zuj23QlYYcMQWyaFM/3Q6v0unpKxTNUx1a6aWO9cFy I3effWdMPVixU3hGDrEuVoPVQF3U3Dsk1YXK6I1IXgc7TFAqtf3A/calaGSGYzSoP8B1 JDOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=skE4+s60NrQLo0S/T8nR7ttXJ2NyNtWVRALWmqUOKYw=; b=r7jrYl2IndUKyAnLeyel/sfcQe2ENlvp9LhXBgYptZxSWOwO5gJ4Gxivj6QBxMEmgu oWfddnwpZSowGKJkzQT/T1zrwiPtXFFQb+iGPmXLZP/J+FHj+yTK5+8XcVUrVVpm6trP x6BzHUSL8ZrcCf6N1VsTPHjTvgsivdQuRzWkfKLB7qYn5xnUf6Od383+awXdtIOv+nrD pfCPh0z1g1wOzvF3S3mmR+JyengZmjpSet+aExuhe2Kz+Quy0UoNf6zXCTczb2U1foaX gSngAjq7DNkoFWbkMsv6QCRsOIWIQ7MC1x0w3hIdx2YCGinhY+UfAoQMeBtYdQ9ZNQHh 9aDQ== 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 v11si2685846pgo.483.2017.10.12.07.01.00; Thu, 12 Oct 2017 07:01: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 S1752195AbdJLOA6 (ORCPT + 27 others); Thu, 12 Oct 2017 10:00:58 -0400 Received: from foss.arm.com ([217.140.101.70]:47530 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751186AbdJLOA4 (ORCPT ); Thu, 12 Oct 2017 10:00:56 -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 A1C5A1529; Thu, 12 Oct 2017 07:00:56 -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 197213F236; Thu, 12 Oct 2017 07:00:54 -0700 (PDT) From: Dietmar Eggemann To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Russell King , Vincent Guittot , Juri Lelli Subject: [PATCH v2 0/1] arm: remove cpu_efficiency Date: Thu, 12 Oct 2017 15:00:27 +0100 Message-Id: <20171012140028.21599-1-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org v1: review results [1]: Vincent pointed out that there is a superfluous continue statement in parse_dt_topology(). Got rid of it. Krzysztof Kozlowski took the exynos and Simon Horman the renesas related dt bits into their for-next (v4.15) branches. *** For Cortex-A15/A7 arm big.LITTLE systems there are currently two ways to set the cpu capacity. The first one (commit 06073ee26775 "ARM: 8621/3: parse cpu capacity-dmips-mhz from DT") is based on dt 'cpu capacity-dmips-mhz' bindings and the appropriate dt parsing code in drivers/base/arch_topology.c. It further takes differences in maximum cpu frequency values into consideration, normalizes the maximum cpu capacity to SCHED_CAPACITY_SCALE (1024) and scales all the cpus accordingly. cpu capacity = (capacity-dmips-mhz * max cpu frequency) / (max capacity-dmips-mhz * max (max cpu frequency) This solution is shared between arm and arm64 and works for other combinations of big and little cpus (besides Cortex-A15/A7) as well. The second one (commit 339ca09d7ada "ARM: 7463/1: topology: Update cpu_power according to DT information" is based on the 'struct cpu_efficiency table_efficiency[]' and the dt parsing code in arch/arm/kernel/topology.c. It further requires a clock-frequency property per cpu node, calculates a so called middle frequency for an average cpu in the system which is as close as possible to SCHED_CAPACITY_SCALE (1024) and uses this to compute the cpu capacity values. cpu capacity = (cpu efficiency * clock frequency) / middle capacity This solution only works for Cortex-A15/A7 arm big.LITTLE systems. The aim of this patch is to have only one solution for all arm and arm64 big.LITTLE platforms. (1) Therefore, it removes the code for the 'cpu_efficiency/ clock-frequency dt property' (second) solution. (2) Moreover, it will also assure that the highest original cpu capacity (rq->cpu_capacity_orig) in a non-smt system is SCHED_CAPACITY_SCALE (1024). (3) And finally, another advantage is the dynamic detection of the max cpu frequency which comes with the first solution instead of the static clock-frequency dt property value. Currently, the arm dt parsing code in parse_dt_topology() checks if the dt uses the capacity-dmips-mhz property. If this is the case it uses the first, otherwise the second solution. This patch removes the code for the second solution from arch/arm/kernel/topology.c. With the dt related patches for exynos and renesas now in the appropriated for-next branches for v4.15 there are no Cortex-A15/A7 arm big.LITTLE systems left relying on the 'cpu_efficiency/clock-frequency dt property' based solution anymore. This patch has been tested on TC2 and Samsung Chromebook 2 13" (peach-pi, Exynos 5800). [1] https://marc.info/?l=linux-kernel&m=150410411807050&w=2 Changes v1->v2: - Rebase on top of v4.14-rc4 - Remove superfluous continue statement in parse_dt_topology() [01/04] - Remove 'cpu capacity scale management' and 'cpu capacity table' related comments [01/04] - Remove dt related patches [02-04/04] Dietmar Eggemann (1): arm: topology: remove cpu_efficiency arch/arm/kernel/topology.c | 132 ++------------------------------------------- 1 file changed, 4 insertions(+), 128 deletions(-) -- 2.11.0