Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7922032ybi; Thu, 6 Jun 2019 03:51:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqx+oB25iEpH2U2iPkLnSlpz0+5PW04pLLEW1H8M8gvj0ATbbME9xD9A3CpkjhSGNtHZDbhd X-Received: by 2002:a63:360c:: with SMTP id d12mr2720948pga.285.1559818307028; Thu, 06 Jun 2019 03:51:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559818307; cv=none; d=google.com; s=arc-20160816; b=oYCSYw2PPpZ4FY9iQ7zm3uuWDvT24BF5f/5Sqwh/IKWrwEsafP9fkjFri11IvrRxtP f05wZ13CQyrR3I8oXKbJwSUR5Gjcokx3zBy9r/wkIS4MdDgJvhVNl3WsvEbhhg1M5sks iYLy+ZJLIwrUhedWy3uI+S/w1fakXS8hiPDB4mWkYGZfhrsxy9szWxyEhXe32+JBlaRH 5AEsWnXEouCIxW/JO5I8XpNEaCgpkUY8UjhqeENCth5fu+RKWCTjNOO3vcLlqGwJMgxD XIji/FTU53jNkbiSSrozMCXUqy/bcB/l9IAsTWqp5pF3OzjgLtUZ9xSOQW2YJAgm2/P8 r5aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=C/Pi72TBH1OiLe6EXorIfyGFgkSbQB6RQOasgJDB4Vc=; b=r+eufN5pAEEL0mgJHsTqdcOdqO8jCsO8UNDMsLdrzr/7bW7GjFPHJ7JVZtkKhC4nzf O5fFg5eE0WrGqLT0yxjA6xhuEzhxTzrkUGX/fLupqtlLD6UYRz5g/XqfEzTbAXaOMwrQ Q6E7/R61TPtSWCXUdKGIW0it3xxKH9EJr16DoOD1mzcIXgTvhvyf6JjK1gsQbQotVK6n ZOx77vCRSuZDFc0Sip1SQfKZNytYkTMiAug2LmuhEWQwveX1QBjQUsnVPSD5FSkSuoWI NJVn06D3h1R1rTrhQMy8H8JAoFY8/vsiJggA4PltSqLm5ACbA/q8gduDu+WE1UxMFfeH KaxA== 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 i1si1522316pfd.258.2019.06.06.03.51.29; Thu, 06 Jun 2019 03:51:47 -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 S1727178AbfFFKuY (ORCPT + 99 others); Thu, 6 Jun 2019 06:50:24 -0400 Received: from foss.arm.com ([217.140.101.70]:45292 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725784AbfFFKuX (ORCPT ); Thu, 6 Jun 2019 06:50: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 DA9FFA78; Thu, 6 Jun 2019 03:50:22 -0700 (PDT) Received: from e105550-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 383063F690; Thu, 6 Jun 2019 03:50:20 -0700 (PDT) Date: Thu, 6 Jun 2019 11:50:17 +0100 From: Morten Rasmussen To: Vincent Guittot Cc: Dietmar Eggemann , Quentin Perret , Stephen Boyd , Amit Kucheria , Andy Gross , Matthias Kaehlcke , David Brown , Rob Herring , Mark Rutland , linux-arm-msm , "open list:ARM/QUALCOMM SUPPORT" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML , Douglas Anderson , Rajendra Nayak Subject: Re: [PATCH] arm64: dts: sdm845: Add CPU topology Message-ID: <20190606105017.GD10919@e105550-lin.cambridge.arm.com> References: <155786856719.14659.2902538189660269078@swboyd.mtv.corp.google.com> <5cdf2dc8.1c69fb81.521c8.9339@mx.google.com> <20190605172048.ahzusevvdxrpnebk@queper01-ThinkPad-T460s> <20190606074921.43mbinemk3j565yu@queper01-ThinkPad-T460s> <9267b9ed-89b0-7b71-88a2-ca1894d4c497@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 06, 2019 at 10:44:58AM +0200, Vincent Guittot wrote: > On Thu, 6 Jun 2019 at 10:34, Dietmar Eggemann wrote: > > > > On 6/6/19 10:20 AM, Vincent Guittot wrote: > > > On Thu, 6 Jun 2019 at 09:49, Quentin Perret wrote: > > >> > > >> Hi Vincent, > > >> > > >> On Thursday 06 Jun 2019 at 09:05:16 (+0200), Vincent Guittot wrote: > > >>> Hi Quentin, > > >>> > > >>> On Wed, 5 Jun 2019 at 19:21, Quentin Perret wrote: > > >>>> > > >>>> On Friday 17 May 2019 at 14:55:19 (-0700), Stephen Boyd wrote: > > >>>>> Quoting Amit Kucheria (2019-05-16 04:54:45) > > >>>>>> (cc'ing Andy's correct email address) > > >>>>>> > > >>>>>> On Wed, May 15, 2019 at 2:46 AM Stephen Boyd wrote: > > >>>>>>> > > >>>>>>> Quoting Amit Kucheria (2019-05-13 04:54:12) > > >>>>>>>> On Mon, May 13, 2019 at 4:31 PM Amit Kucheria wrote: > > >>>>>>>>> > > >>>>>>>>> On Tue, Jan 15, 2019 at 12:13 AM Matthias Kaehlcke wrote: > > >>>>>>>>>> > > >>>>>>>>>> The 8 CPU cores of the SDM845 are organized in two clusters of 4 big > > >>>>>>>>>> ("gold") and 4 little ("silver") cores. Add a cpu-map node to the DT > > >>>>>>>>>> that describes this topology. > > >>>>>>>>> > > >>>>>>>>> This is partly true. There are two groups of gold and silver cores, > > >>>>>>>>> but AFAICT they are in a single cluster, not two separate ones. SDM845 > > >>>>>>>>> is one of the early examples of ARM's Dynamiq architecture. > > >>>>>>>>> > > >>>>>>>>>> Signed-off-by: Matthias Kaehlcke > > >>>>>>>>> > > >>>>>>>>> I noticed that this patch sneaked through for this merge window but > > >>>>>>>>> perhaps we can whip up a quick fix for -rc2? > > >>>>>>>>> > > >>>>>>>> > > >>>>>>>> And please find attached a patch to fix this up. Andy, since this > > >>>>>>>> hasn't landed yet (can we still squash this into the original patch?), > > >>>>>>>> I couldn't add a Fixes tag. > > >>>>>>>> > > >>>>>>> > > >>>>>>> I had the same concern. Thanks for catching this. I suspect this must > > >>>>>>> cause some problem for IPA given that it can't discern between the big > > >>>>>>> and little "power clusters"? > > >>>>>> > > >>>>>> Both EAS and IPA, I believe. It influences the scheduler's view of the > > >>>>>> the topology. > > >>>>> > > >>>>> And EAS and IPA are OK with the real topology? I'm just curious if > > >>>>> changing the topology to reflect reality will be a problem for those > > >>>>> two. > > >>>> > > >>>> FWIW, neither EAS nor IPA depends on this. Not the upstream version of > > >>>> EAS at least (which is used in recent Android kernels -- 4.19+). > > >>>> > > >>>> But doing this is still required for other things in the scheduler (the > > >>>> so-called 'capacity-awareness' code). So until we have a better > > >>>> solution, this patch is doing the right thing. > > >>> > > >>> I'm not sure to catch what you mean ? > > >>> Which so-called 'capacity-awareness' code are you speaking about ? and > > >>> what is the problem ? > > >> > > >> I'm talking about the wake-up path. ATM select_idle_sibling() is totally > > >> unaware of capacity differences. In its current form, this function > > >> basically assumes that all CPUs in a given sd_llc have the same > > >> capacity, which would be wrong if we had a single MC level for SDM845. > > >> So, until select_idle_sibling() is 'fixed' to be capacity-aware, we need > > >> two levels of sd for asymetric systems (including DynamIQ) so the > > >> wake_cap() story actually works. > > >> > > >> I hope that clarifies it :) > > > > > > hmm... does this justifies this wrong topology ? No, it doesn't. It relies heavily on how nested clusters are interpreted too, so it is quite fragile. > > > select_idle_sibling() is called only when system is overloaded and > > > scheduler disables the EAS path > > > In this case, the scheduler looks either for an idle cpu or for evenly > > > spreading the loads > > > This is maybe not always optimal and should probably be fixed but > > > doesn't justifies a wrong topology description IMHO > > > > The big/Little cluster detection in wake_cap() doesn't work anymore with > > DynamIQ w/o Phanton (DIE) domain. So the decision of going sis() or slow > > path is IMHO broken. > > That's probably not the right thread to discuss this further but i'm > not sure to understand why wake_cap() doesn't work as it compares the > capacity_orig of local cpu and prev cpu which are the same whatever > the sche domainœ We have had this discussion a couple of times over the last couple of years. The story, IIRC, is that when we introduced capacity awareness in the wake-up path (wake_cap()) we realised (I think it was actually you) that we could use select_idle_sibling() in cases where we know that the search space is limited to cpus with sufficient capacity so we didn't have to take the long route through find_idlest_cpu(). Back then, big and little were grouped by clusters so it was "safe" to use select_idle_sibling() on cpu or prev_cpu if they have sufficient capacity. With DynamiQ the true topology on many systems is just one cluster and hence using select_idle_sibling() there means search space includes all cpu types which isn't "safe" if you have a task requiring more capacity than can be offered by any cpu in the system. We need to use the find_idlest_cpu() path on more cases than we do today. All the code is there I think, we just have to tweak some conditions. I can try to come up with a simple fix we can discuss and refine as necessary. Morten