Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp483324rdh; Thu, 26 Oct 2023 07:33:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHcaF3zP+4yUUJ19qzFn4ewkXs/ZdJBTYvyrTcKbZ0s6j+Hxfw1oSaL+MA8+7xdJ1VAxtV0 X-Received: by 2002:ad4:5aea:0:b0:66d:48f8:e637 with SMTP id c10-20020ad45aea000000b0066d48f8e637mr23142053qvh.34.1698330804022; Thu, 26 Oct 2023 07:33:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698330804; cv=none; d=google.com; s=arc-20160816; b=EIPD0G7OXT8WNQVec/Z+cgZ2cdSqMdNFsuR9yN8eEX/AtlmAyqtt5dex+r3qiFw8hg mUROFNskExmyTp+RHnFo6Lkkwg58NQ8Q+/ue/5xxHrr2pYJNGQHvfF+HfGD63OvK25RD LyquMBUTJdPKAgjD9ykPKR4xIJsC0On6szm0OI7vvoZA6fvfcvceZj0F/vxylwcWAaRF 43Cd8XZSmcWid+PxeGPYcSfRpDiD4v7ZPEt6ZkFu+mCTCTCc6uUSG2FCUhVIhZIVT1HI PXuT8ql2yQVJTf94KCTuWhPaCZzMoKZZOmmVjJecrmFYVHk1WzM1t6f4C4+ws8yUGRj8 by1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=cyPzF6zImIluItqkN237S1HDHY3vs2wBArSwbVc/hzA=; fh=sHvrjpZIo7ZCu3jPCugxQ0Uyw+lgbD59pNHN0qPBfaE=; b=MNHIL1o8sRvBDdZExOEJ4Cg+/sgoctDOMdwsvQKZzn3GtuH7tLEICJr7R6D8usc9kh yphH9LtJsB9v6/ZeVqi1xRazEvWqH0EFdPoJriWKGoTfrZMgFp5na9Km8oAfNbXz1fzj 59f1jtqoIdCo/3pfk/iODHSwN0qROj0a50JDU+44xYVZMAMvkc+YVNX6nVrd4EtOkOkD 6REgZXIdZcIR/7tchqCupHcrmU26cK3DpnVtL+azp9g8lkQZp1Jr6ztk7U28/saGaWlO ivecHxUbDEyZDweM15AzI4iJ6c1gmH23TZCVqmfLUM0Lrpdlc3e3GjTUjhdK8joxJcd3 Gbtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z2dEkPdF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id l15-20020a0ce84f000000b0066d1f749b1fsi9632220qvo.574.2023.10.26.07.33.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 07:33:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z2dEkPdF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 5A3EE80D6A05; Thu, 26 Oct 2023 07:33:03 -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 S1345255AbjJZObJ (ORCPT + 99 others); Thu, 26 Oct 2023 10:31:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345240AbjJZObI (ORCPT ); Thu, 26 Oct 2023 10:31:08 -0400 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F0791AE for ; Thu, 26 Oct 2023 07:31:06 -0700 (PDT) Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-517ab9a4a13so860014a12.1 for ; Thu, 26 Oct 2023 07:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698330665; x=1698935465; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=cyPzF6zImIluItqkN237S1HDHY3vs2wBArSwbVc/hzA=; b=z2dEkPdFfUlgbOE45z4yUdd/p2adlb/iOdWRpd+vaiDpn+D9rjuT/ONKaIae3IY7R9 S2HOZOWACm/u59cenOkLecHRR/9yS17fPTf7U+w1oYzac/JAC9jHqnMdYhhgHYL6Ou14 7e6b0WjSKjW4EZwtEJeS8VEZsnO3RrCb+R9Gb1NYYJc7iq7W9GGPweL+LuRWdSaa8KGV izPA0C88gnjevyA8WQYcEUJK4WZY/ovecw7ctYkyEhlhtky0AFoRlVupMhYPtlRdUcmw g3HTbL4WKZoTxIZAP3FLSIRFadR71HmAcOj+bf26TjKEoz9oOvMTCokxb4pf8dw3fGfN jU2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698330665; x=1698935465; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cyPzF6zImIluItqkN237S1HDHY3vs2wBArSwbVc/hzA=; b=M4sPI/kyg2MZk/Vu1Dok02fcNa6x4MewqjC1IebveSwfsqZJQlVr8iX10iSEFomJvU 0NG+i0Mp6AvnOvrVBWq7efrxEwjwbOW21o5f9QjlkzbjDiCd2muc9Gp2XzgDc75nkjQl uiVmH6ogYTQjfuzS++t3/0OUEfkVvqJUMB7yg4T/4zb36LGiL0kjD4S8jLqWIBsAHTYl CYvVQouGulsjOouGTZsce+CCq8LfisZCXy5lmo7E9EM165yf3qaydWONwy/Mb38fDvm0 agaxyioOtiek4Z1E2fNPM2fHJ0zdFfHTcuxTVH1GgVNltYMS+qAw7F2pTRdWpfJ4I9Vu pQ9w== X-Gm-Message-State: AOJu0YworeZUfWvuwEzTNBG+TBLHXYOHTvUBkYIPYXjT9nQsXwBBdzRz aP2sRjLUMCXi8BYgzW4m0cTVNrGpih/PFNwh0j5MeQ== X-Received: by 2002:a17:90a:1c8:b0:27d:6dd:fb7d with SMTP id 8-20020a17090a01c800b0027d06ddfb7dmr19390459pjd.17.1698330665193; Thu, 26 Oct 2023 07:31:05 -0700 (PDT) MIME-Version: 1.0 References: <20231018162540.667646-1-vincent.guittot@linaro.org> <20231018162540.667646-7-vincent.guittot@linaro.org> In-Reply-To: From: Vincent Guittot Date: Thu, 26 Oct 2023 16:30:53 +0200 Message-ID: Subject: Re: [RFC v3 6/6] arm64/amu: use capacity_ref_freq to set AMU ratio To: Dietmar Eggemann Cc: Ionela Voinescu , 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 07:33:03 -0700 (PDT) On Thu, 26 Oct 2023 at 13:19, Dietmar Eggemann wrote: > > 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. something like : " The default value of the ratio (saved in per_cpu(arch_max_freq_scale) 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. " Or I can rename the variable per_cpu(arch_max_freq_ratio) > > 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) > > [...] >