Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp114500pxj; Thu, 3 Jun 2021 02:12:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIR9+36WRWON/sDGTjXMUAkiUPonKd1kPy5eLB7iTw8U17pOeetu+2KRdo4M3uR5r0COeS X-Received: by 2002:a17:906:3888:: with SMTP id q8mr14308226ejd.15.1622711555917; Thu, 03 Jun 2021 02:12:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622711555; cv=none; d=google.com; s=arc-20160816; b=oPCscydkJyJW1DaJS/wQT3pjj4erzB4K68YxxQ8NWMMWoQo2v64HlVws99aeQSmA7B 8l8lm9HtS05JalzJXSXfqslkpz++2v7BJylXw+Vujx0K0HxacdFYs0qQ8WBshiO0EHir LLGTBcDunSlolHMwxua0tBuGbfFgwWDo8nH4RHQ0P60gDywpoZuO0T5XXY5+2QQgEWec 8NfUW969R2wnH+Nc6zHiifA5U2NtUShlvir28xnn1Ty7711a/Am4ygar9EopB4WydktH 4hdkTCmovHH3CR+j4KYv0HxaCddDXaLkgAWEEzR0gMMd4JR8c7LArtq417eycuFzG7WA 55MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=jpP3dtrPBKd0tkblF3uD+6O3Tp62AjWA55p7LxEjv5I=; b=NT9OoV8+2Xc0ZBibd4ER/khWFyylAhsd21EMhvuukGsYUON3IshpQU+Da+uj4dRzGX QtXIIHJSb+Nfk6DI5JsmYeCNRJUEaB/HkCHld+MQkAAM2dfwhZDICrW0xRxy9QlJuHJN /4THPNbf3HnUzfseGjNRI2ZbSjX2t6SLNO0+VMOzPaP9PkrLEd4n9pSbQGmhkAlnsd2x yqrxXEuzagMk3jfUYIw/j6Qvi4xQ65aAXvVpCf+yPxFp1eqMePmb52CGSGF+NlbRDFyq 4WyawhvucIgDZr1kHXK+y/3Ub2Kgq3l8BpRt2PxT2gfHyQ9lxhpOka4IofpQSPPt2Izz 49YQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f12si2566663ejl.315.2021.06.03.02.12.13; Thu, 03 Jun 2021 02:12:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229744AbhFCJLh (ORCPT + 99 others); Thu, 3 Jun 2021 05:11:37 -0400 Received: from foss.arm.com ([217.140.110.172]:36104 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbhFCJLg (ORCPT ); Thu, 3 Jun 2021 05:11:36 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 55E1113A1; Thu, 3 Jun 2021 02:09:52 -0700 (PDT) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 51EEA3F774; Thu, 3 Jun 2021 02:09:50 -0700 (PDT) Subject: Re: [PATCH v5 2/3] sched/topology: Rework CPU capacity asymmetry detection To: Beata Michalska Cc: Valentin Schneider , linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, corbet@lwn.net, rdunlap@infradead.org, linux-doc@vger.kernel.org References: <87a6oj6sxo.mognet@arm.com> <20210525102945.GA24210@e120325.cambridge.arm.com> <98ad8837-b9b8-ff50-5a91-8d5951ee757c@arm.com> <20210526121546.GA13262@e120325.cambridge.arm.com> <20210526125133.GB13262@e120325.cambridge.arm.com> <20210526214004.GA1712@e120325.cambridge.arm.com> <14593ba7-eed9-f035-724c-5cadbb859adc@arm.com> <20210527170729.GA20994@e120325.cambridge.arm.com> <4f43a9a8-b64e-bb47-b3c1-f51165f40249@arm.com> <20210602194805.GA18136@e120325.cambridge.arm.com> From: Dietmar Eggemann Message-ID: <32ffee58-5ea9-1e01-c134-9fb90d1b1771@arm.com> Date: Thu, 3 Jun 2021 11:09:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210602194805.GA18136@e120325.cambridge.arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/06/2021 21:48, Beata Michalska wrote: > On Wed, Jun 02, 2021 at 07:17:12PM +0200, Dietmar Eggemann wrote: >> On 27/05/2021 19:07, Beata Michalska wrote: >>> On Thu, May 27, 2021 at 05:08:42PM +0200, Dietmar Eggemann wrote: >>>> On 26/05/2021 23:40, Beata Michalska wrote: >>>>> On Wed, May 26, 2021 at 08:17:41PM +0200, Dietmar Eggemann wrote: >>>>>> On 26/05/2021 14:51, Beata Michalska wrote: >>>>>>> On Wed, May 26, 2021 at 01:15:46PM +0100, Beata Michalska wrote: >>>>>>>> On Wed, May 26, 2021 at 11:52:25AM +0200, Dietmar Eggemann wrote: >>>>>>>>> On 25/05/2021 12:29, Beata Michalska wrote: >>>>>>>>>> On Tue, May 25, 2021 at 10:53:07AM +0100, Valentin Schneider wrote: >>>>>>>>>>> On 24/05/21 23:55, Beata Michalska wrote: >>>>>>>>>>>> On Mon, May 24, 2021 at 07:01:04PM +0100, Valentin Schneider wrote: >>>>>>>>>>>>> On 24/05/21 11:16, Beata Michalska wrote: [...] > So what I have done is : > > diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c > index 77e6f79235ad..ec4ae225687e 100644 > --- a/kernel/sched/topology.c > +++ b/kernel/sched/topology.c > @@ -1324,6 +1324,7 @@ asym_cpu_capacity_classify(struct sched_domain *sd, > if (!asym_cap_miss) > sd_asym_flags |= SD_ASYM_CPUCAPACITY_FULL; > > + WARN_ONCE(cpu_smt_flags() & sd->flags, "Detected CPU capacity asymmetry on SMT level"); > leave: > return sd_asym_flags; > } > > Comment can be adjusted. > This would sit in the classify function to nicely wrap asymmetry bits in one > place. What do you think ? ... and you would need to pass in the sched domain pointer ;-) Still prefer to check it in sd_init() since there is where we set the flags. But you can't do 'cpu_smt_flags() & sd->flags'. MC level would hit too, since it has SD_SHARE_PKG_RESOURCES as well.