Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2093175pxa; Mon, 3 Aug 2020 07:20:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwk8taw+tGF9Zpp4jswYYVv/jw5zg+FjPEqWS+Q4rrXcELKNxFzPEpyzp+q1V5kTOuPFMzp X-Received: by 2002:a17:906:8318:: with SMTP id j24mr16226145ejx.409.1596464404524; Mon, 03 Aug 2020 07:20:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596464404; cv=none; d=google.com; s=arc-20160816; b=h7Okxcs/DO+NEONsecRqYmpNDdcqNMUG/gFPZh8ACkVZMMhEsQNF1nZZqcEhvSOVtI FYbVNUJTFtipKMxfeU1T/aAVqC3lxH5MhFYGmpBE8h3elIOSgrYb3hoC2Gl/T1jbemAq S4Ta+4i3SP/Ox7QWjFUQhS+FBEV3I3GBQjdldMmkoor9EaxnGY3RtHx/8DKZxxEPnKhV 8dcN0ehO5SCJuJMGBWrRzCcky5sfV8VQSj9rF5X9v/wv/aSSm62YvcuV6GBZFQi4MyZf XJwQLkuptZI5SdOhC4z0BvWHrKnSLRb5jJxAhpt1QDQgYRtMdG9p/4+qjFsbBmJSAoHP NSpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=RLOIXwlridXO9YbNmoRD54brQsBnAZVEssBByZo9S04=; b=SQoYcWYUR9qQuP10ltREW9imrh2HhVTJGXw8Q+H7eBBwFy6sk9NpSFWlfuMt4PqFlA eJ5AAtSqj3BfuYkWwGtpGxGU3ge/8HP9shAj13gdNb/l7X+Kbtw0ZpGwQeWacay7Em2p P5+QjE2Hi3H2IeoeAOGA0g1ZuGHMx/xcRg9+/tlOEJGvlUq7xdpYfaEvVWOUv4tcH690 LMC8llmBOzvcYWDEjMPtMkgQgjm0U2BoEX00YaGjVkNWS0gFR1sJMCWzQl7NTMLgaCDH NFALmWjBuX/rBFeR3uhKOst78kDCJmGCu9mxmzkBWN8u4RymftOUz/lfpGH9HXKZD24k ZF6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k17si9148651ejv.169.2020.08.03.07.19.41; Mon, 03 Aug 2020 07:20:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728366AbgHCOQh (ORCPT + 99 others); Mon, 3 Aug 2020 10:16:37 -0400 Received: from foss.arm.com ([217.140.110.172]:58208 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726767AbgHCOQh (ORCPT ); Mon, 3 Aug 2020 10:16:37 -0400 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 621C130E; Mon, 3 Aug 2020 07:16:36 -0700 (PDT) Received: from localhost (unknown [10.1.198.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E5F933F718; Mon, 3 Aug 2020 07:16:35 -0700 (PDT) Date: Mon, 3 Aug 2020 15:16:34 +0100 From: Ionela Voinescu To: "Rafael J. Wysocki" Cc: Viresh Kumar , "Rafael J. Wysocki" , Dietmar Eggemann , Catalin Marinas , Sudeep Holla , Will Deacon , Russell King - ARM Linux , Ingo Molnar , Peter Zijlstra , Linux PM , Linux ARM , Linux Kernel Mailing List , Valentin Schneider Subject: Re: [PATCH v2 1/7] cpufreq: move invariance setter calls in cpufreq core Message-ID: <20200803141634.GA30107@arm.com> References: <20200722093732.14297-1-ionela.voinescu@arm.com> <20200722093732.14297-2-ionela.voinescu@arm.com> <20200730034128.k4fmblfuwjcmqdze@vireshk-mac-ubuntu> <20200803132617.GA9512@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rafael, On Monday 03 Aug 2020 at 15:46:59 (+0200), Rafael J. Wysocki wrote: > On Mon, Aug 3, 2020 at 3:26 PM Ionela Voinescu wrote: > > > > Hi guys, > > > > On Thursday 30 Jul 2020 at 09:11:28 (+0530), Viresh Kumar wrote: > > > On 27-07-20, 15:48, Rafael J. Wysocki wrote: > > > > On Wed, Jul 22, 2020 at 11:38 AM Ionela Voinescu > > > > wrote: > > > > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > > > > > index 036f4cc42ede..bac4101546db 100644 > > > > > --- a/drivers/cpufreq/cpufreq.c > > > > > +++ b/drivers/cpufreq/cpufreq.c > > > > > @@ -2058,9 +2058,16 @@ EXPORT_SYMBOL(cpufreq_unregister_notifier); > > > > > unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy, > > > > > unsigned int target_freq) > > > > > { > > > > > + unsigned int freq; > > > > > + > > > > > target_freq = clamp_val(target_freq, policy->min, policy->max); > > > > > + freq = cpufreq_driver->fast_switch(policy, target_freq); > > > > > + > > > > > + if (freq) > > > > > + arch_set_freq_scale(policy->related_cpus, freq, > > > > > + policy->cpuinfo.max_freq); > > > > > > > > Why can't arch_set_freq_scale() handle freq == 0? > > > > > > > Sorry, I seem to have missed this question the first time around. > > > > arch_set_freq_scale() could handle freq == 0, but given that freq == 0 > > is signaling an error here, I do believe this check is well placed, to > > prevent a useless call to arch_set_freq_scale(). Also [1]: > > So let me rephrase: > > Doesn't this check add overhead in the empty arch_set_freq_scale() case? Yes, you are right, I did not consider that. I can add a patch for the arch_topology driver's arch_set_freq_scale() to handle this and we can remove it from here. Thank you for pointing this out, Ionela.