From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D6F3C38BE0 for ; Mon, 24 Feb 2020 18:40:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5FBE220836 for ; Mon, 24 Feb 2020 18:40:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QexFg9At" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5FBE220836 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date: In-reply-to:Subject:To:From:References:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=GafVfZKhIvlByWlRhwCnfiOWIZtmtmcCHnGdcRfZ0Lo=; b=QexFg9AtVtN3V7S/YkImnKzqMq rcxomFMySjLttPD6Pi7/53RhPCG50kl+tydj7g4BUt1oGFG4z9oRCWZLR15QQfsm8AeIcS56y3PKD Fq2xc4o1VkUO6h+zeS1jqDZ3KX+8i8o1xbNYtxt4yJw3NtZNgC/9KPwaTDEneKn+/I/tzAEyhLC+z FHNZoB1dTmXO/UAc48itZm01Yp2UrJ2BkYH9mEOrh/oFlDOEdt1pK05XtDStPTTOdUSZLceUPJPyj 5q5DNDYFfRHvFZ6e8Sx855awBpe1u/3+MslZAVfa7RxQPbeLGGlBrjE2GVw/ClBSK3bn/SuzxS62b GFyHyFIw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j6Iet-0003vx-7j; Mon, 24 Feb 2020 18:40:47 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j6Iep-0003vE-De for linux-arm-kernel@lists.infradead.org; Mon, 24 Feb 2020 18:40:44 +0000 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 E67821FB; Mon, 24 Feb 2020 10:40:42 -0800 (PST) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B57113F703; Mon, 24 Feb 2020 10:40:40 -0800 (PST) References: <20200224141142.25445-1-ionela.voinescu@arm.com> <20200224141142.25445-7-ionela.voinescu@arm.com> User-agent: mu4e 0.9.17; emacs 26.3 From: Valentin Schneider To: Ionela Voinescu Subject: Re: [PATCH v4 6/7] arm64: use activity monitors for frequency invariance In-reply-to: <20200224141142.25445-7-ionela.voinescu@arm.com> Date: Mon, 24 Feb 2020 18:40:38 +0000 Message-ID: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200224_104043_542744_AB76EE7F X-CRM114-Status: GOOD ( 12.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, maz@kernel.org, suzuki.poulose@arm.com, peterz@infradead.org, catalin.marinas@arm.com, linux-pm@vger.kernel.org, linux-doc@vger.kernel.org, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, mingo@redhat.com, viresh.kumar@linaro.org, linux-arm-kernel@lists.infradead.org, sudeep.holla@arm.com, will@kernel.org, dietmar.eggemann@arm.com, lukasz.luba@arm.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Ionela Voinescu writes: > Signed-off-by: Ionela Voinescu > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Sudeep Holla With the small nits below: Reviewed-by: Valentin Schneider > diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c > index fa9528dfd0ce..7606cbd63517 100644 > --- a/arch/arm64/kernel/topology.c > +++ b/arch/arm64/kernel/topology.c > + > +static inline int That should be bool, seeing what it returns. > +enable_policy_freq_counters(int cpu, cpumask_var_t valid_cpus) > +{ > + struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); > + > + if (!policy) { > + pr_debug("CPU%d: No cpufreq policy found.\n", cpu); > + return false; > + } > + > + if (cpumask_subset(policy->related_cpus, valid_cpus)) > + cpumask_or(amu_fie_cpus, policy->related_cpus, > + amu_fie_cpus); > + > + cpufreq_cpu_put(policy); > + > + return true; > +} > diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c > index 1eb81f113786..1ab2b7503d63 100644 > --- a/drivers/base/arch_topology.c > +++ b/drivers/base/arch_topology.c > @@ -29,6 +29,14 @@ void arch_set_freq_scale(struct cpumask *cpus, unsigned long cur_freq, > unsigned long scale; > int i; > > + /* > + * If the use of counters for FIE is enabled, just return as we don't > + * want to update the scale factor with information from CPUFREQ. > + * Instead the scale factor will be updated from arch_scale_freq_tick. > + */ > + if (arch_cpu_freq_counters(cpus)) > + return; > + > scale = (cur_freq << SCHED_CAPACITY_SHIFT) / max_freq; > > for_each_cpu(i, cpus) > diff --git a/include/linux/topology.h b/include/linux/topology.h > index eb2fe6edd73c..397aad6ae163 100644 > --- a/include/linux/topology.h > +++ b/include/linux/topology.h > @@ -227,5 +227,12 @@ static inline const struct cpumask *cpu_cpu_mask(int cpu) > return cpumask_of_node(cpu_to_node(cpu)); > } > > +#ifndef arch_cpu_freq_counters > +static __always_inline > +bool arch_cpu_freq_counters(struct cpumask *cpus) > +{ > + return false; > +} > +#endif > Apologies for commenting on this only now, I had missed it in my earlier round of review. I would've liked to keep this contained within arm64 stuff until we agreed on a more generic counter-driven FIE interface, but seems like we can't evade it due to the arch_topology situation. Would it make sense to relocate this stub to arch_topology.h instead, at least for the time being? That way the only non-arm64 changes are condensed in arch_topology (even if it doesn't change much in terms of header files, since topology.h imports arch_topology.h) > #endif /* _LINUX_TOPOLOGY_H */ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel