From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756554AbcGYWeZ (ORCPT ); Mon, 25 Jul 2016 18:34:25 -0400 Received: from mail-pf0-f169.google.com ([209.85.192.169]:36817 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754954AbcGYWeW (ORCPT ); Mon, 25 Jul 2016 18:34:22 -0400 Date: Mon, 25 Jul 2016 15:34:10 -0700 From: Viresh Kumar To: Jisheng Zhang Cc: vireshk@kernel.org, nm@ti.com, sboyd@codeaurora.org, rjw@rjwysocki.net, gregkh@linuxfoundation.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3] PM / OPP: optimize dev_pm_opp_set_rate() performance a bit Message-ID: <20160725223410.GF25667@ubuntu> References: <1469427076-2078-1-git-send-email-jszhang@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1469427076-2078-1-git-send-email-jszhang@marvell.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25-07-16, 14:11, Jisheng Zhang wrote: > In dev_pm_opp_set_rate(), _find_opp_table() is called 4 times: once by > _get_opp_clk(), once by dev_pm_opp_set_rate() itself, and twice by > dev_pm_opp_find_freq_ceil(). If there are several opp_tables in the > system, three times of opp table finding is a big waste. This patch > reduced the call of _find_opp_table() to twice. > > Signed-off-by: Jisheng Zhang > --- > Since v2: > - fix gcc warnings > > Since v1: > - avoid opp_table pointer usage after the rcu_read_unlock() as pointed > out by Viresh, thus we can only reduced the call of _find_opp_table > to twice. > > drivers/base/power/opp/core.c | 31 +++++++++++++++++++------------ > 1 file changed, 19 insertions(+), 12 deletions(-) Acked-by: Viresh Kumar -- viresh