Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1235815rdh; Fri, 27 Oct 2023 08:19:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFqXTsyAj8hnbz83Bs7Y5xXOE1T1V17/fvs8VultlRO23/Ru4xEI9zwrgax2uDToJ5jJLVX X-Received: by 2002:a25:3c9:0:b0:da0:4076:49d with SMTP id 192-20020a2503c9000000b00da04076049dmr11153740ybd.15.1698419975803; Fri, 27 Oct 2023 08:19:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698419975; cv=none; d=google.com; s=arc-20160816; b=n4BjadvJ4qalN7KH2KGz5VhvBTCzEdKgFXTb2E1AHCe+zTVhfXWUE+6CyyGGECjUnA nHdCTqtMhLi07CmANYyqzVj0VKjVCoZRNQS7zC8h7YnUTArQbB+6ZyMkC3fZfmtzwrrl hpdy3fHiwSM4tnQ7mkze3QZ6TLk94xHx5Fzvs7ATmV7uiUPb85eHkwmHutACc9oF0crQ OWoJf+6zKFLlk+YQhCFVItGXsL2m+aE99RTwxE01ubHnZz3mKkyt0RG1UWbu1j2enwly TSVEMoTkLl7fWTbToHZcwm26JFGQkl7lb+1a2tJk8LkQH5Dm2vQTymhsETnPC1UlM+gm Xdrw== 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=W/jyxUKjs+ivpArfOLxbtvoP8jhQ6Kn3kdcGQik3464=; fh=AnQiADOCtYfROHOCf3PyspmbacbGxScr4it9q063OxM=; b=cL3bdFWO/EUyYivs4tIEDs2aA72rqtmVm+ZC1ECVAaz238o6iE3SncEWZTkbv/4gAr qYM00P93FrkB0MJIbBW7v1ZTtC3ASQp0ehzod7Ulu2sv82BGQdgO3zpEMoZJ1IOTRpPT pcuh7uIsxMCTNfZ8Ez/7oL51YWvhriVAtAh6JgOOM5/FM7UZeV8doeWRhQQb4dOF+64x FOOMQLONzcSjISdF1ms/HJ3KJhxqbWi0gby+pJo084AqOzCYxQ5mCFTfAjuhg6C5iMbJ SrOAMwtT8GA9MfFalK1wz5EHlZ5mDQsqsly3LlsD+dqoh2fR5ig5hbJc4Sus8/zt4b4X 6rzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t5dz3JOS; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id j63-20020a255542000000b00d9a58bbff71si2790006ybb.530.2023.10.27.08.19.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 08:19:35 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=t5dz3JOS; 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=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 fry.vger.email (Postfix) with ESMTP id E8FC5834032F; Fri, 27 Oct 2023 08:19:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346278AbjJ0PTY (ORCPT + 99 others); Fri, 27 Oct 2023 11:19:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231594AbjJ0PTW (ORCPT ); Fri, 27 Oct 2023 11:19:22 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62B5E1AA for ; Fri, 27 Oct 2023 08:19:20 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-5b8a88038b4so2511926a12.1 for ; Fri, 27 Oct 2023 08:19:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698419960; x=1699024760; 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=W/jyxUKjs+ivpArfOLxbtvoP8jhQ6Kn3kdcGQik3464=; b=t5dz3JOSfKZgW8Sobzq+LJBU5J1pp60EKogyCKLZ2CwqFxpDX6CpsOZ19rrk5SBNtp VZTgFKZ5R13bAqMFf8EALaD+grB8h1bso+csJX7T6+BKCuMHiCKIR3oCDUge40PQv0sP bTv25e2d1YI2GOIV3AlzTgKqRF8XqXzmxsnQAv/QnalnMnmZ3rBMN1vxEU//CO3TN7TR B8RIJsvcOR6j2T6TO+ru0E6ZRim8p6dMorFviqqVC761UFld3qw0yjY0N3UbAi4ELVFm +33ZAaqA5OOw47zMdDFxgmAoOxKLvow315DyoO6+3mjXNO3YGRe6DmrRvwrWR79kfo8r mcyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698419960; x=1699024760; 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=W/jyxUKjs+ivpArfOLxbtvoP8jhQ6Kn3kdcGQik3464=; b=sg3CxzTziL3OtNedmFUGVb5rQFaY2z473QlKj9pR9BnIef6sPybBfMLdv1xtRL98VO Wr6Z9csPTTNBx1sMSbxz4T4SfU2Mb6boH4dwIzKR0TeEjpPYdhPCjbdwKX5aQ0G1Mk/l IcjCw/joJ2U7xKtA4Nww53XQ+RJMxYiZrtz2FwKNfDOIIEowis9BuCDz6lKquM+Sqhax jrycnqPbaHhEk1Zy44uBY0g0UJrL1iYOTuDqYBNjLqiBnlvCmxcfHCcJPhVQX2Gw8Lv1 3nhivpiUsdMggRzuERES4sVwToi1up5AFs+KyjjLDkP3vZjJAePTW2ewHjVBcz+l5ijw dLEg== X-Gm-Message-State: AOJu0YzCNBzCIvJLEFSNCGwJPPTsgj+XjIj5PRvK9GwoYebFe5WLYIKF Tp5obVmlQhpDeNIsSm4RfjKS/FRqlJwFhNNgsohstA== X-Received: by 2002:a17:90b:33c8:b0:274:77b3:64d0 with SMTP id lk8-20020a17090b33c800b0027477b364d0mr7422882pjb.17.1698419959769; Fri, 27 Oct 2023 08:19:19 -0700 (PDT) MIME-Version: 1.0 References: <20231027080400.56703-1-vincent.guittot@linaro.org> <20231027080400.56703-2-vincent.guittot@linaro.org> In-Reply-To: From: Vincent Guittot Date: Fri, 27 Oct 2023 17:19:07 +0200 Message-ID: Subject: Re: [PATCH v4 1/7] topology: add a new arch_scale_freq_reference To: Ingo Molnar 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, ionela.voinescu@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 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]); Fri, 27 Oct 2023 08:19:33 -0700 (PDT) On Fri, 27 Oct 2023 at 11:31, Ingo Molnar wrote: > > > * Vincent Guittot wrote: > > > --- a/include/linux/arch_topology.h > > +++ b/include/linux/arch_topology.h > > @@ -27,6 +27,13 @@ static inline unsigned long topology_get_cpu_scale(int cpu) > > > > void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity); > > > > +DECLARE_PER_CPU(unsigned long, capacity_ref_freq); > > + > > +static inline unsigned long topology_get_freq_ref(int cpu) > > +{ > > + return per_cpu(capacity_ref_freq, cpu); > > +} > > + > > DECLARE_PER_CPU(unsigned long, arch_freq_scale); > > So mind naming it in a way that expresses that this is indeed a maximum > frequency? arch_scale_ref_freq_max or so? This does not always have to be the max frequency of the CPU but the frequency that has been used to compute the capacity of the CPU so it's the "reference" frequency used for computing the capacity and that must be used to compute the capacity for a given frequency and the other way. That 's why I have intentionally not used freq_max Then other similar functions start with arch_scale_freq_something > > Also, is there any particular concept behind naming one new symbol > 'freq_ref', the other 'ref_freq'? If not then please standardize on one > variant. no particular reason. ref_freq comes from "reference frequency" but interfaces follows arch_scale_freq_something or topology_*_freq_something so we should keep freq_ref to keep interfaces aligned > > Thanks, > > Ingo