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=-7.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 6F145C433E9 for ; Wed, 27 Jan 2021 07:00:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2AFE320723 for ; Wed, 27 Jan 2021 07:00:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231338AbhA0HAP (ORCPT ); Wed, 27 Jan 2021 02:00:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232357AbhA0G7l (ORCPT ); Wed, 27 Jan 2021 01:59:41 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F8C6C061573 for ; Tue, 26 Jan 2021 22:58:49 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id l18so752974pji.3 for ; Tue, 26 Jan 2021 22:58:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=hdH070fYQGRrVFXSs6VUzPA20L1MAMda+ejAucezRlo=; b=bcxwQY9v7gG8/ZLRsynArRtdDbnVjaCQYtuVwVy4gAD09HJ0afvA9irJzEB9sle0aI rOJweiDeWGPx5J1nbkpKcf22eLrwJ2GJu8oNzqJ8NFQdlrkcsFG9hMMaPgx7ZnNralqJ bXiqaEZyrKKD9h9vOUiGT0e9cY0riXPAjo3ar9rJXXTr6rWQQGUnG+he/PyqPS0y9Mfd Yvg4RvXCCeorEy3smliUnT/OrysHSP6tcCR6b+dRweRZFZMMEaSNJbNh+CgICb4xryRf 5PsnDzVJUqLlOHOjfIicTMFhn7pSqTUkxbScpKohKp3OB2avLlmBf0UsKnsITVnppNIw 4Qfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=hdH070fYQGRrVFXSs6VUzPA20L1MAMda+ejAucezRlo=; b=ja1dvCsWyCXjqTormyCgQpxIce2wfozaRKcPJxw7Ijc0LzIvbLWpsZRAPbUECfSWUJ llysF8ZYHaBJb9t8KVFVNYdt1G3Y44+BXPHSq/HWBBjl2ln2hYUSxOPpNZMI5+CbmpyV Oio31D14iuec7M4Gu7BExmYLAQwJou2mPqLiU7lSxvSTt+rQyh2Gs8johgT1cafGkLOw fyRNFbzqYzuCKgaNZMESdiXPKde/5MVNm5FO4j/oxxesxbtZ9EaTbB7Ln8/tr1P3+tkN /6Oug0/uw/NLTG78mIkKzEnD493u5/2xYc+Uax5Yzvkb8dF0RRrnCQdXbqdwLAcnmdZc s4ug== X-Gm-Message-State: AOAM531g1pLBb+VeTnVBS9Pn+IXas6J29Oh1U4qFT7/SDwFb8UPAnC8I fGdcaEmJIboMcjObXHLYjh2bp8Hgye/pJw== X-Google-Smtp-Source: ABdhPJyaTToGexohyPD3a1AnlyINM47VgWjzZWARW91p7Tk9RAH8ZSmplUpcdPIxJZ4yB7OyWIpFyA== X-Received: by 2002:a17:90a:de2:: with SMTP id 89mr4105815pjv.26.1611730729086; Tue, 26 Jan 2021 22:58:49 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id j16sm947790pjj.18.2021.01.26.22.58.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jan 2021 22:58:48 -0800 (PST) Date: Wed, 27 Jan 2021 12:28:46 +0530 From: Viresh Kumar To: Dmitry Osipenko Cc: Viresh Kumar , Nishanth Menon , Stephen Boyd , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Sibi Sankar , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, "linux-tegra@vger.kernel.org" Subject: Re: [PATCH 07/13] opp: Allow _generic_set_opp_clk_only() to work for non-freq devices Message-ID: <20210127065846.c2usquegqrqib45r@vireshk-i7> References: <1585f6c21ea8aee64fe4da0bf72b36ea4d74a779.1611227342.git.viresh.kumar@linaro.org> <9b2638e6-b842-8737-e5a0-aeeb84927fce@gmail.com> <20210122043506.lm6yiefzlyubq5my@vireshk-i7> <7d6573e3-7885-fb0b-2290-c181e2c557f9@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7d6573e3-7885-fb0b-2290-c181e2c557f9@gmail.com> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org On 26-01-21, 00:09, Dmitry Osipenko wrote: > Please remove unlikely() around IS_ERR(), it already has the unlikely(). Right. > https://elixir.bootlin.com/linux/v5.11-rc4/source/include/linux/err.h#L22 > > I'd also recommend to remove all the unlikely() from OPP code since it > doesn't bring any value if not used in a very performance-critical code > path. OPP core doesn't have such code paths. The [un]likely() only make > code less readable and may result in a worse assembly. The likely/unlikely() stuff is to optimize code, not necessarily the stuff in the hot path alone, therwise stuff like IS_ERR() would never have it. It surely does bring value by optimizing the code, surely the result isn't significant enough but that is fine, every effort counts. AFAIK, if we are sure of path the code will almost always take, then we should rather use these and so I am inclined towards keeping them. Though I understand that using them may result in bad behavior (performance) if they fail. -- viresh 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=-5.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 0F696C4332D for ; Wed, 27 Jan 2021 07:00:58 +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 BB10B20723 for ; Wed, 27 Jan 2021 07:00:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB10B20723 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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=wI41q5einZy9d/hO205xRKy1OxUEXfiHavFYN3fjSro=; b=2K1VrmgT59eKfRzszyjynpHqr I4pZqhOrE1MuY5Wv/Gre1859/gDnAHv/hUGQpUb91XHEkXvHHpAcLTDTgEqgAmFVOvXMaSu7cBbfM CsTRl3QGeNsQMvxr0JdDc8hjHaH7q9pIl/WX5KwUrYi0W7KtovzKsBYheA39gU+cKC64QxyzOmvq1 h6dx6iULCEqPVKRZ1V/ytOTQfI2evTdQVTPspZ26PagoGGMvbeFEULo10avWONXmc/Nr6bf1Dr5E3 srdnT/q4I+b+BAf3WobLFw0L4RkPmus+C0QqSGsh4oFKOu+VDahj52RWV5jHPN1p4InycJj+APRsy fvbu6fOdw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4en1-0005CJ-SK; Wed, 27 Jan 2021 06:58:55 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4emx-0005Bq-Ob for linux-arm-kernel@lists.infradead.org; Wed, 27 Jan 2021 06:58:53 +0000 Received: by mail-pj1-x1032.google.com with SMTP id jx18so746423pjb.5 for ; Tue, 26 Jan 2021 22:58:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=hdH070fYQGRrVFXSs6VUzPA20L1MAMda+ejAucezRlo=; b=bcxwQY9v7gG8/ZLRsynArRtdDbnVjaCQYtuVwVy4gAD09HJ0afvA9irJzEB9sle0aI rOJweiDeWGPx5J1nbkpKcf22eLrwJ2GJu8oNzqJ8NFQdlrkcsFG9hMMaPgx7ZnNralqJ bXiqaEZyrKKD9h9vOUiGT0e9cY0riXPAjo3ar9rJXXTr6rWQQGUnG+he/PyqPS0y9Mfd Yvg4RvXCCeorEy3smliUnT/OrysHSP6tcCR6b+dRweRZFZMMEaSNJbNh+CgICb4xryRf 5PsnDzVJUqLlOHOjfIicTMFhn7pSqTUkxbScpKohKp3OB2avLlmBf0UsKnsITVnppNIw 4Qfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=hdH070fYQGRrVFXSs6VUzPA20L1MAMda+ejAucezRlo=; b=RnslFia3dkEeARlsJoE3mUQR0puJRVnbzTuzR08I273Q1fPrhQMWdNYBfyz1LKpgIP AjfgVmkjGfdwer8onFpALDMQHS7JLg3HznmCRvoES42CSzLlnNzRCqbTYzxohtnol23Z sZDVMsQXaj9I4KBrODrlzltOAXwg8f9jtmLGGKVkNk6/lJRw8kyGTNQyhcWTDp1mhjqY lhjW3itam0Rw6jx23CDlrnSCT4y2tYZSOQocdnc6k2zmvQEyFKsvZ7OjdacAR/nHGVAb /9uKYrG/MS1ciCg+ZfIvrg395bEWg/0iPQLYbtKfrNmuAnM/14dhj4vR8QH5S9OsApOH bdOg== X-Gm-Message-State: AOAM533/RIGbfeo+86InQmNdAsVPNXa+KqC0MII5W+mPVuNilH/iNWJE y6x2g2MZoTu6iYMcbXukdjxNHA== X-Google-Smtp-Source: ABdhPJyaTToGexohyPD3a1AnlyINM47VgWjzZWARW91p7Tk9RAH8ZSmplUpcdPIxJZ4yB7OyWIpFyA== X-Received: by 2002:a17:90a:de2:: with SMTP id 89mr4105815pjv.26.1611730729086; Tue, 26 Jan 2021 22:58:49 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id j16sm947790pjj.18.2021.01.26.22.58.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jan 2021 22:58:48 -0800 (PST) Date: Wed, 27 Jan 2021 12:28:46 +0530 From: Viresh Kumar To: Dmitry Osipenko Subject: Re: [PATCH 07/13] opp: Allow _generic_set_opp_clk_only() to work for non-freq devices Message-ID: <20210127065846.c2usquegqrqib45r@vireshk-i7> References: <1585f6c21ea8aee64fe4da0bf72b36ea4d74a779.1611227342.git.viresh.kumar@linaro.org> <9b2638e6-b842-8737-e5a0-aeeb84927fce@gmail.com> <20210122043506.lm6yiefzlyubq5my@vireshk-i7> <7d6573e3-7885-fb0b-2290-c181e2c557f9@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <7d6573e3-7885-fb0b-2290-c181e2c557f9@gmail.com> User-Agent: NeoMutt/20180716-391-311a52 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210127_015852_019667_25ED2B2D X-CRM114-Status: GOOD ( 12.74 ) 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: Nishanth Menon , Vincent Guittot , linux-pm@vger.kernel.org, Stephen Boyd , Viresh Kumar , Rafael Wysocki , linux-kernel@vger.kernel.org, Sibi Sankar , "linux-tegra@vger.kernel.org" , linux-arm-kernel@lists.infradead.org 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 On 26-01-21, 00:09, Dmitry Osipenko wrote: > Please remove unlikely() around IS_ERR(), it already has the unlikely(). Right. > https://elixir.bootlin.com/linux/v5.11-rc4/source/include/linux/err.h#L22 > > I'd also recommend to remove all the unlikely() from OPP code since it > doesn't bring any value if not used in a very performance-critical code > path. OPP core doesn't have such code paths. The [un]likely() only make > code less readable and may result in a worse assembly. The likely/unlikely() stuff is to optimize code, not necessarily the stuff in the hot path alone, therwise stuff like IS_ERR() would never have it. It surely does bring value by optimizing the code, surely the result isn't significant enough but that is fine, every effort counts. AFAIK, if we are sure of path the code will almost always take, then we should rather use these and so I am inclined towards keeping them. Though I understand that using them may result in bad behavior (performance) if they fail. -- viresh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel