Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp354316rdh; Thu, 26 Oct 2023 04:20:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHnjJEDJig0qKtIyZguNsQWKksAtei071JbmH5zJ0yLRcomIOIm+MDO0ma96ayEjf/8dp3E X-Received: by 2002:a81:a187:0:b0:5a7:ab55:b9af with SMTP id y129-20020a81a187000000b005a7ab55b9afmr19696559ywg.35.1698319210027; Thu, 26 Oct 2023 04:20:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698319210; cv=none; d=google.com; s=arc-20160816; b=qcOarEF5VDglZvy3aGqV1mEVdoFxDaonBxCKyOf1TQ3DCVvE2POGv36VX2ulcrQcmy vZ2HNODzYbPoHylmySgYFt4y30Ts21bYK/C3TZJf0JWnet7Xrhqf49RzPHjqG3I9jfgN T4AWV2reAau3wStjb6p2YnAjid3yBZWkmGior03CRADIceCF5/yetxSgm9kOtUsyBiGi AjYkxucz6JeXAadLcaRzKdWmU2NMTndW6+czgazaTu73AYXdw5ltLnkjFLEF9leBicNJ IrOh37ne7GGvIyLUel26XL+eBYQ/qz97pciZf+nLb4I19vrDolRq6K7fIAHuts6TKgwq pGuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=Au/W6o3qtSRnGgaPRQVMqBkjNHSPfKjusRFJcAk8mKI=; fh=zRz8K967wOpkbmnsRqpbw4RTFzt6JQ8wMXtd2dtnYcE=; b=ZH4Bwwkqu92OW+n7lxvN7m3y62RaonF6oJMptLibZiy0Vj91CMtxxfsKuTgdJNzP5s IGI8uTyxwDtuNQttEeb8/AqLtbiPbYOjkkJrEKksOCCJTVToGC2K2C3KYVDx4OZzwtl+ YxdQhq+tQw/V9AHBovkG6C3qMpr80Okki0eI1qEEBVYOFMFhvM+7ZKjMqYi7cUpWi76e QsmFm0xNU5x9qxf96apmoc+fkPeEmd28j/qEQPC3I6MLB0MLSP01c1MBH7/uqfG7SZzT rJ+DnT0Q6MFaKRoBjvpiT26oFBxNWvP6QFPl+ixMw8xefGgZ+YQqigX5xxjY5H+jr6Uk fOOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id i12-20020a81d50c000000b0058c8abb3664si15692860ywj.508.2023.10.26.04.20.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 04:20:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 96B9780984BE; Thu, 26 Oct 2023 04:20:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230455AbjJZLT7 (ORCPT + 99 others); Thu, 26 Oct 2023 07:19:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229980AbjJZLT6 (ORCPT ); Thu, 26 Oct 2023 07:19:58 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 169591AE; Thu, 26 Oct 2023 04:19:56 -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 2B8D12F4; Thu, 26 Oct 2023 04:20:37 -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 8CA653F738; Thu, 26 Oct 2023 04:19:50 -0700 (PDT) Message-ID: Date: Thu, 26 Oct 2023 13:19:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC v3 6/6] arm64/amu: use capacity_ref_freq to set AMU ratio Content-Language: en-US To: Vincent Guittot , Ionela Voinescu 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, 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, 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, acpica-devel@lists.linuxfoundation.org, conor.dooley@microchip.com, suagrfillet@gmail.com, ajones@ventanamicro.com, lftan@kernel.org References: <20231018162540.667646-1-vincent.guittot@linaro.org> <20231018162540.667646-7-vincent.guittot@linaro.org> From: Dietmar Eggemann In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Thu, 26 Oct 2023 04:20:06 -0700 (PDT) On 24/10/2023 11:58, Vincent Guittot wrote: > On Mon, 23 Oct 2023 at 22:58, Ionela Voinescu wrote: >> >> Hi, >> >> On Wednesday 18 Oct 2023 at 18:25:40 (+0200), Vincent Guittot wrote: >>> Use the new capacity_ref_freq to set the ratio that is used by AMU for >>> computing the arch_scale_freq_capacity(). >>> This helps to keep everything aligned using the same reference for >>> computing CPUs capacity. >>> >>> The default value of the ratio ensures that arch_scale_freq_capacity() >>> returns max capacity until it is set to its correct value with the >>> cpu capacity and capacity_ref_freq. Nitpick: Could you mention that arch_max_freq_scale is the default value for this ratio? Took me a while to recreate the (not so simple) story for this change, i.e. make the connection between ratio and arch_max_freq_scale. init_cpu_capacity_callback() freq_inv_set_max_ratio() u64 ratio ... per_cpu(arch_max_freq_scale, cpu) = (unsigned long)ratio ^^^^^^^^^^^^^^^^^^^ static struct scale_freq_data amu_sfd = { .set_freq_scale = amu_scale_freq_tick, } #define arch_scale_freq_tick topology_scale_freq_tick topology_scale_freq_tick() sfd->set_freq_scale() amu_scale_freq_tick() ... scale *= this_cpu_read(arch_max_freq_scale) ^^^^^^^^^^^^^^^^^^^ ... this_cpu_write(arch_freq_scale, (unsigned long)scale); #define arch_scale_freq_capacity topology_get_freq_scale topology_get_freq_scale(cpu) return per_cpu(arch_freq_scale, cpu) [...]