Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3604282pxp; Tue, 15 Mar 2022 02:13:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymdEecRDYBWL0oCMwBMiryJVIzDBLKtlfs0Lnlgxt6L8mkYBpaKeeG8MhVI5bkdfIiIwhb X-Received: by 2002:a63:d64d:0:b0:374:6edc:989c with SMTP id d13-20020a63d64d000000b003746edc989cmr23077456pgj.434.1647335638232; Tue, 15 Mar 2022 02:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647335638; cv=none; d=google.com; s=arc-20160816; b=edl1J5ZQLCMqmQu5FHHhbwkcRVC1E6UEkte3GASVfV4BmcnioakFxsOZgcyK/oWJhi jdeuxmePoydeGlK/3mO5f01fbNzxjZlU3IM6CQataee5TMOZ2/ONteR0tN/D8uLoj0yU gp1yQ2mvUezrjOS2ZbcCK5Wf/XObOICoXd71C1TEU5Li5MNMLBKg3sspSlc9wZy14sTv ym1roaF4AEpoKv/eDJbkKaDYnx0ZfTdC6/YtrOdKixDgQfqZz/ICR+lw7JIp/XvKdKwt vMEH6bKpGp9GsIdH9ZM1Dt0hKSJCMZ/ceM3y4uqpFfcNwWtXiodQmI6tWBvgzBoiyA0v LE4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=dHkwbb/l1/npAQtH8A78RGckf7ttahoYe8tWWTTbP3s=; b=S24I/sgshIfM0nTQdD7upfa7R9G9iJ2thZumB1Agp3vWLSA4pqnFuSgnXi4AOQjHhw soiXQnxREPwBtEUbgIkWCA/xQUkJsFWhNAb5A9x7bR2ED6lquRYxIGhN/Z/7A5RhY4mj Ngd/sCgFGr2j0FZ3uiEk0ft7y4EgyUHqoXtiGNNxDhZVuH0irEA7OEq7B3NRakTtLnKZ zjlVXfVPRRrkFcadMSsg6dHSrUZ7Y6Nfv5tU5LtFSMHSx1MPmAGNIVwvhllslqtkJ4BD /qTCNU7Ab7yJRxiC3N45oYHGolLiQi4eGs/V1wtSyhDb1/aAZYlxOPdCrFhKNX2AY0Sl F2PQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i1-20020a170902cf0100b0014fe2ca91a1si18667534plg.12.2022.03.15.02.13.46; Tue, 15 Mar 2022 02:13:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231989AbiCNSMn (ORCPT + 99 others); Mon, 14 Mar 2022 14:12:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243628AbiCNSMM (ORCPT ); Mon, 14 Mar 2022 14:12:12 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C97453F89C for ; Mon, 14 Mar 2022 11:11:00 -0700 (PDT) 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 8ECDC1474; Mon, 14 Mar 2022 11:11:00 -0700 (PDT) Received: from localhost (ionvoi01-desktop.cambridge.arm.com [10.1.196.65]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 30E383F66F; Mon, 14 Mar 2022 11:11:00 -0700 (PDT) Date: Mon, 14 Mar 2022 18:10:58 +0000 From: Ionela Voinescu To: Leo Yan Cc: Sudeep Holla , Greg Kroah-Hartman , "Rafael J. Wysocki" , Vincent Guittot , Bryan O'Donoghue , linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 0/3] arch_topology: Correct CPU capacity scaling Message-ID: References: <20220313055512.248571-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220313055512.248571-1-leo.yan@linaro.org> X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Leo, On Sunday 13 Mar 2022 at 13:55:09 (+0800), Leo Yan wrote: > This patch set is to address issues for CPU capacity scaling. > > "capacity-dmips-mhz" property might be absent in all CPU nodes, and in > another situation, DT might have inconsistent binding issue, e.g. some > CPU nodes have "capacity-dmips-mhz" property and some nodes miss the > property. Current code mixes these two cases and always rollback to CPU > capacity 1024 for these two cases. > > Patches 01 and 02 in this set are used to distinguish the two different > DT binding cases, and for the inconsistent binding issue, it rolls back > to 1024 without CPU capacity scaling. > > Patch 03 is to handle the case for absenting "capacity-dmips-mhz" > property in CPU nodes, the patch proceeds to do CPU capacity scaling based > on CPU maximum capacity. Thus it can reflect the correct CPU capacity for > Arm platforms with "fast" and "slow" clusters (CPUs in two clusters have > the same raw capacity but with different maximum frequencies). > In my opinion it's difficult to handle absent "capacity-dmips-mhz" properties, as they can be a result of 3 scenarios: potential.. 1. bug in DT 2. unwillingness to fill this information in DT 3. suggestion that we're dealing with CPUs with same u-arch (same capacity-dmips-mhz) I'm not sure it's up to us to interpret suggestions in the code so I believe treating missing information as error is the right choice, which is how we're handling this now. For 3. (and patch 03), isn't it easier to populate capacity-dmips-mhz to the same value (say 1024) in DT? That is a clear message that we're dealing with CPUs with the same u-arch. Thanks, Ionela. > This patch set is applied on the mainline kernel with the latest commit > 68453767131a ("ARM: Spectre-BHB: provide empty stub for non-config"). > And tested on Arm64 Hikey960 platform (with a bit hacking to emulate > fast and slow clusters). > > > Leo Yan (3): > arch_topology: Correct semantics for 'cap_parsing_failed' > arch_topology: Handle inconsistent binding of CPU raw capacity > arch_topology: Scale CPU capacity if without CPU raw capacity > > drivers/base/arch_topology.c | 42 +++++++++++++++++++++++++++++------- > 1 file changed, 34 insertions(+), 8 deletions(-) > > -- > 2.25.1 > >