Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1259825rwb; Thu, 8 Dec 2022 08:29:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf6pBbsk6uRjV9fTLC6nDZSH2UeHL0KHbwmdsnzwJWHkc8dxRKrTRDPqMG6fE9cOWaEyz35m X-Received: by 2002:a17:902:c206:b0:189:502e:4ec8 with SMTP id 6-20020a170902c20600b00189502e4ec8mr72863346pll.134.1670516960462; Thu, 08 Dec 2022 08:29:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670516960; cv=none; d=google.com; s=arc-20160816; b=h7TIKmH2kWI9fcV6jlfNADzKtpRCAyioq99bqyQYNYiJroh4JPJ3vfGyfRxtlhENuT x2iMzG7J319wiQCfwq4WhOzeUELHWc2nJq6Td7E3jnsEwteR16MLMpVsLiFIkRf4/ty5 LPzq5JXvNmCB7MlpsFHkxkSFJRyneOsMUE5CcNzy2K1uwV7BKHLlE7uVSqXEFFFOqT7O c/uKNHvker/ssCUkXKgMSLqDDbH4nFBbyEPe4mzwICJ86KM4nrl7dojysqddlEoeH4yS ye+Q9/7AkeJAOkNTTHEdqp/X682dYT48cGGoQkpdNZ7XV1T3aehaxSw0ppg012XH3y+2 LbEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=29yxejKkukF5kFUPHEAz3CIyOHhiN4xkX5hrQUELHR4=; b=ORipw0qNnJsUq2qponSOFiLsgdPXVZUexBODEuvZbp8iyRHTh1EzVj/dB8oMYiHN5r vhwyHwsll4Z+9AVNYJnMiIWHGzE7y2HgmJOzfp3ptQOM7gplWIcjBRHjW9tCpvNLnMi6 vp9PIS20ztRK0Mt2ZHxNfVUcsaPcE1VTyUPrV5v8iGd7XDkXXSKd1xioI/ycQdHbHjq9 5dCYZhgZLmYTYZPJM5C/yjWH4D3XKeBqYxHhsNcmycLexOivrL2MkXer2toZ2y/gqSN2 oVMECH1rLQO5QmkLdiVKrAqJIAzakAR93PzhKLsvp1QN+ieuQUK4H6Ro0jOMCZTHpZZh Y89g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e14-20020a63d94e000000b00477b4b68f09si23088971pgj.258.2022.12.08.08.29.07; Thu, 08 Dec 2022 08:29:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229963AbiLHQDl (ORCPT + 72 others); Thu, 8 Dec 2022 11:03:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229592AbiLHQDj (ORCPT ); Thu, 8 Dec 2022 11:03:39 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 217F99E471; Thu, 8 Dec 2022 08:03:38 -0800 (PST) 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 A6294D6E; Thu, 8 Dec 2022 08:03:44 -0800 (PST) Received: from e123648.arm.com (unknown [10.57.9.192]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0FD743F73D; Thu, 8 Dec 2022 08:03:34 -0800 (PST) From: Lukasz Luba To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rafael@kernel.org Cc: lukasz.luba@arm.com, viresh.kumar@linaro.org, dietmar.eggemann@arm.com, vincent.guittot@linaro.org, saravanak@google.com, wusamuel@google.com, isaacmanjarres@google.com, kernel-team@android.com, juri.lelli@redhat.com, peterz@infradead.org, mingo@redhat.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de Subject: [PATCH v3 0/1] cpufreq: schedutil: Optimize operations in hot path frequency switch Date: Thu, 8 Dec 2022 16:02:55 +0000 Message-Id: <20221208160256.859-1-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, This v3 is an attempt to optimize some of not needed operations in the frequency change code path for the shared freq. domain. There was different approach which was too aggressive and failed due to working on a stale CPU capacity information. changes: v3: - follow Vincent recommendation to drop the sg_policy::max, I have instead tried to reduce the lookup and cache pressure, but use local var passing to functions when needed - unfortunately I couldn't use Viresh's ACKs for the v2 patches, since the code has changed heavily - updated the patch header with description of the code flow and the issue, since I thought this optimization reason should be better explained, so people can refer to it, since the former approach was reverted v2: - split the patch into two (Viresh) v1: - simple approach which fetches CPU capacity every time it's needed, not relaying on the setup value, which was causing issues. Regards, Lukasz Lukasz Luba (1): cpufreq: schedutil: Optimize operations with single CPU capacity lookup kernel/sched/cpufreq_schedutil.c | 43 +++++++++++++++++--------------- 1 file changed, 23 insertions(+), 20 deletions(-) -- 2.17.1