From patchwork Mon May 23 10:58:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Morten Rasmussen X-Patchwork-Id: 68364 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp13681qge; Mon, 23 May 2016 03:59:39 -0700 (PDT) X-Received: by 10.98.51.132 with SMTP id z126mr25724425pfz.23.1464001179436; Mon, 23 May 2016 03:59:39 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f2si51079576paa.118.2016.05.23.03.59.38; Mon, 23 May 2016 03:59:39 -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 S932117AbcEWK7g (ORCPT + 30 others); Mon, 23 May 2016 06:59:36 -0400 Received: from foss.arm.com ([217.140.101.70]:50183 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754470AbcEWK6s (ORCPT ); Mon, 23 May 2016 06:58: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 2B3CB46D; Mon, 23 May 2016 03:59:10 -0700 (PDT) Received: from e105550-lin.cambridge.arm.com (e105550-lin.cambridge.arm.com [10.1.207.130]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B10603F246; Mon, 23 May 2016 03:58:46 -0700 (PDT) From: Morten Rasmussen To: peterz@infradead.org, mingo@redhat.com Cc: dietmar.eggemann@arm.com, yuyang.du@intel.com, vincent.guittot@linaro.org, mgalbraith@suse.de, linux-kernel@vger.kernel.org, Morten Rasmussen , Russell King Subject: [PATCH 14/16] arm: Set SD_ASYM_CPUCAPACITY for big.LITTLE platforms Date: Mon, 23 May 2016 11:58:56 +0100 Message-Id: <1464001138-25063-15-git-send-email-morten.rasmussen@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1464001138-25063-1-git-send-email-morten.rasmussen@arm.com> References: <1464001138-25063-1-git-send-email-morten.rasmussen@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Set the SD_ASYM_CPUCAPACITY flag for DIE level sched_domain on big.LITTLE systems. cc: Russell King Signed-off-by: Morten Rasmussen --- arch/arm/kernel/topology.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) -- 1.9.1 diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index ec279d1..1b81b31 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -78,6 +78,7 @@ static unsigned long *__cpu_capacity; #define cpu_capacity(cpu) __cpu_capacity[cpu] static unsigned long middle_capacity = 1; +static unsigned int big_little; /* * Iterate all CPUs' descriptor in DT and compute the efficiency @@ -151,6 +152,8 @@ static void __init parse_dt_topology(void) middle_capacity = ((max_capacity / 3) >> (SCHED_CAPACITY_SHIFT-1)) + 1; + if (max_capacity && max_capacity != min_capacity) + big_little = 1; } /* @@ -280,12 +283,17 @@ static inline int cpu_corepower_flags(void) return SD_SHARE_PKG_RESOURCES | SD_SHARE_POWERDOMAIN; } +static inline int arm_cpu_cpu_flags(void) +{ + return big_little ? SD_ASYM_CPUCAPACITY : 0; +} + static struct sched_domain_topology_level arm_topology[] = { #ifdef CONFIG_SCHED_MC { cpu_corepower_mask, cpu_corepower_flags, SD_INIT_NAME(GMC) }, { cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) }, #endif - { cpu_cpu_mask, SD_INIT_NAME(DIE) }, + { cpu_cpu_mask, arm_cpu_cpu_flags, SD_INIT_NAME(DIE) }, { NULL, }, };