Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3951023rdh; Tue, 28 Nov 2023 08:01:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IELowqE2C+JPCc73U0y4dtD/7HAiwhzwvrDyP11cBC2iKwkYNhyZHMl1nPxDAhLdo1R04va X-Received: by 2002:a17:902:d2cf:b0:1cf:d660:5b01 with SMTP id n15-20020a170902d2cf00b001cfd6605b01mr7410806plc.27.1701187260358; Tue, 28 Nov 2023 08:01:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701187260; cv=none; d=google.com; s=arc-20160816; b=AFIEIoimcZ+CW/XMrJwGcPuBooDph82lKYK/0qiRlvvfvU+kg8c0144lu2D21ZjRsT tU2JiQpvbGCYuCgT/ggJeXiSiLNN6xn2+Bj2BhUQNbG5zNEtOiBMBP9g5OM52mxH/CAT nhl19nyB3gH2racevz2B5hZUiMZY+ceMuDrRZ9smLd58o0y/qE1zjRIXiljAaJNAl0Qg klezhCIJdpECxIAxEenz3PUm4z1W0X6DcPYl2kfgo4K1f6REzPo2NZdsC6phM2UoK3q5 pFPZuS+b6jC/mpXUadDw2NPUpk+y2dJbo+MqttF11oVh7h23UEjUTOacT9M44vOcOS5V g3aw== 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=+gVByNpWr5t+Y0dh8jGHLJfeyMumSBf1pfmK4jceIBw=; fh=63/idJzECwiGfit/BMTWGCaWBqz+e4cvxglVeRh4tLo=; b=OZDHn09vwqhK7j7UDWGPOfxxXn3ksG2paL9cjk1AmSGJooiAQm07eLrt/AmiGxAl4Q boZI500MOrurJ1LmCxFCi/mYFPRR/RCfwLJ3vQb3KxYp3+eHlPi3OPYlcSZjwN3g3t5F kDQNQ8zLwj/UWrWr0usmW5KGVxHbx4Bm1Lo3KoarSlRl4uw2lcFEMjzY0sOhNdyBaH3m 64i/ieLPA+th2wxbESjM5bkmvL90i0B9yZr7VZVuz3aNcFCcqY9tRZhrJdk5CHaK+OIh N5IZJHbyhP3i14thhHUU0Vzmpl2bVqUOBcrrjPu0tSXovkq44br1uJ2mv06xMoDNvcpf JxsQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id g16-20020a1709029f9000b001cfc048af27si6324675plq.584.2023.11.28.08.00.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 08:01:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id DF68A80785D2; Tue, 28 Nov 2023 08:00:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346354AbjK1P77 (ORCPT + 99 others); Tue, 28 Nov 2023 10:59:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346239AbjK1P76 (ORCPT ); Tue, 28 Nov 2023 10:59:58 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 426A395; Tue, 28 Nov 2023 08:00:05 -0800 (PST) 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 5472A169E; Tue, 28 Nov 2023 08:00:52 -0800 (PST) Received: from localhost (ionvoi01-desktop.cambridge.arm.com [10.2.78.69]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7E1E43F6C4; Tue, 28 Nov 2023 08:00:04 -0800 (PST) Date: Tue, 28 Nov 2023 16:00:03 +0000 From: Ionela Voinescu To: Vincent Guittot Cc: linux@armlinux.org.uk, catalin.marinas@arm.com, will@kernel.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, sudeep.holla@arm.com, gregkh@linuxfoundation.org, rafael@kernel.org, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, viresh.kumar@linaro.org, lenb@kernel.org, robert.moore@intel.com, lukasz.luba@arm.com, pierre.gondois@arm.com, beata.michalska@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org, conor.dooley@microchip.com, suagrfillet@gmail.com, ajones@ventanamicro.com, lftan@kernel.org Subject: Re: [PATCH v6 1/7] topology: Add a new arch_scale_freq_reference Message-ID: References: <20231109101438.1139696-1-vincent.guittot@linaro.org> <20231109101438.1139696-2-vincent.guittot@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 28 Nov 2023 08:00:18 -0800 (PST) On Tuesday 28 Nov 2023 at 15:52:52 (+0000), Ionela Voinescu wrote: > Hi Vincent, > > I have a small request on this patch, which is useful for [1]. > I'll detail what is needed lower in the code. > > [1] https://lore.kernel.org/lkml/ZWYDr6JJJzBvsqf0@arm.com/ > > On Thursday 09 Nov 2023 at 11:14:32 (+0100), Vincent Guittot wrote: > > @@ -279,13 +278,13 @@ void topology_normalize_cpu_scale(void) > > > > capacity_scale = 1; > > for_each_possible_cpu(cpu) { > > - capacity = raw_capacity[cpu] * per_cpu(freq_factor, cpu); > > + capacity = raw_capacity[cpu] * per_cpu(capacity_freq_ref, cpu); > > The only affected code that I could find is here and below. > > The above line would have to change to: > capacity = raw_capacity[cpu] * per_cpu(capacity_freq_ref, cpu) ?: 1; > > > capacity_scale = max(capacity, capacity_scale); > > } > > > > pr_debug("cpu_capacity: capacity_scale=%llu\n", capacity_scale); > > for_each_possible_cpu(cpu) { > > - capacity = raw_capacity[cpu] * per_cpu(freq_factor, cpu); > > + capacity = raw_capacity[cpu] * per_cpu(capacity_freq_ref, cpu); > > and here: > capacity = raw_capacity[cpu] * per_cpu(capacity_freq_ref, cpu) ?: 1; > > I think it's nicer to start with capacity_freq_ref as 0 and compensate here > for uninitialized capacity_freq_ref. > > Let me know if this is alright of if you'd prefer us to make this change > in a separate patch. > > Thanks, > Ionela. > Correction - both will need to be: capacity = raw_capacity[cpu] * (per_cpu(capacity_freq_ref, cpu) ?: 1); Thanks, Ionela.