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=-8.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 1F4E3C433DF for ; Mon, 3 Aug 2020 14:18:16 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 C8FCB20781 for ; Mon, 3 Aug 2020 14:18:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Q1dinnf7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C8FCB20781 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+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AlBL+OZqwWgKETFKKMbmFGr2JiHWo7KEPP8WAjnapJw=; b=Q1dinnf79OoQ7jjsCDQ7NHTB8 bv6OzIu56kh2BiXiXxffqWsj0n+wQvP/F/W/a/VpncH1sNxkcPy00boSIpfr2GQOtEgM88dt0NRUv wTUCdTqDm47689n5xEk9ZWSkKD9cCeYF4nLj+22pfx+v1kIszVg8FWcPdyNm7HhHMbOS2gxAGPzrg jnJm6tEl3KaVYlDu2JdCLgEvqw1Zm0m5GwG/AUXwJ6j24PcPQ1J7p3FJUZy84sdh8cHZBM0UeaocK AQPcxdn0cRLuoW611JvzkvAWf8sYJDYDA1NYSjpgd12kPHxNSt0gJNo+ihfZOpJqwapBkA192sKD9 68CEwdofw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2bGb-0000IX-KB; Mon, 03 Aug 2020 14:16:41 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2bGY-0000GU-3c for linux-arm-kernel@lists.infradead.org; Mon, 03 Aug 2020 14:16:38 +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 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" 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200803_101638_233424_4C5D0CCC X-CRM114-Status: GOOD ( 22.66 ) 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: Catalin Marinas , Linux PM , Peter Zijlstra , Viresh Kumar , Valentin Schneider , "Rafael J. Wysocki" , Russell King - ARM Linux , Linux Kernel Mailing List , Ingo Molnar , Sudeep Holla , Will Deacon , Dietmar Eggemann , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel