From patchwork Wed Nov 10 09:19:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jane Malalane X-Patchwork-Id: 12611633 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5060C433EF for ; Wed, 10 Nov 2021 09:21:45 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 7F00B611BF for ; Wed, 10 Nov 2021 09:21:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7F00B611BF Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.224229.387397 (Exim 4.92) (envelope-from ) id 1mkjn8-0001br-EX; Wed, 10 Nov 2021 09:21:14 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 224229.387397; Wed, 10 Nov 2021 09:21:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mkjn8-0001bk-B6; Wed, 10 Nov 2021 09:21:14 +0000 Received: by outflank-mailman (input) for mailman id 224229; Wed, 10 Nov 2021 09:21:13 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mkjn7-0001be-4R for xen-devel@lists.xenproject.org; Wed, 10 Nov 2021 09:21:13 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 898eaa30-4207-11ec-9787-a32c541c8605; Wed, 10 Nov 2021 10:21:09 +0100 (CET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 898eaa30-4207-11ec-9787-a32c541c8605 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1636536069; h=from:to:cc:subject:date:message-id:mime-version; bh=B8/23IjAs7tM8yvKwjTqTj7xnzcShUImgDvG/FDUAGE=; b=Y6GU2fR7ZSOnznX0Tkg0UbWjoSJzHZX4hFVXYqF6MUgubBGe8tGNTCTE FAiCz92BUGkeLsrKg9uXA7eMsze9927xd6sZ3lLSGrrRpwI+Kb4jeyWsR yqDe+0wDSjpgbCKTsezWtLEcZdlGYwE9h7CeotS1W5dYJ2dkUThmX/h3x 0=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: Nk5V62544xVTdntOQAd9FxaTRb4MfKO5sISBHuDod2XeGX6FBoGoEQCmxD5+Yk7VYc+kx6LHrq ACuSoy5ooNY+MJ4OEySYPkMzcvzClEcFvcbcwMK/xnvEL7D+ffUu8K65VSa3iwpmpqE3qGcpWP FFrQuIrOwlRU11ICa5QKHnrKAU7TS2LqBRiyOupcp22vlRB5BtZxruIniLpy4Qy2wqQldWMspR K0iAPoCrwxAur5KYihfZ3MqAtvJxJNjEU206aIwkJ3q595a9voP2/TeLuKqXcnNDMVUGJcOJ4o jFZLZb4mHDsRGe3O89sFOll+ X-SBRS: 5.1 X-MesageID: 57485307 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:Q0/afKu+4jDQ6GFEeDBis1+oyufnV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Ul4Y8LsLXoaU9QNt8xoei3gp BlRg2dUlwjyg2PpMwKPZiwxYb/jR88n/3k6ITYtLRCj3H16OdSj66IWdp0We7g79bM8ka4oH qddI8jQUO5STjnn+igGacWvpoJVaxn21xmFODCoYWZjcsc4FRDJ4NLtYiDm6DIKUnisrcI7r rD5jlHbTJMPSh5MFsHTbP7znVq9sWJEwLB5XlfSI8kVc0LpqdA4Jyv0h/4xAscNNRScmWfKi 1fIWU8V/LCfrZU0/d/FgbG/g72oS+YuTFBHG2T77KqtMXWI9GSU3oIdAv2DeirQVT2o9fz6N /lV1fz1LNYOgE1O79hnC79uwK8zu4nvqrtdwlg2FXnHdQ32WLZpI33A1shTrKxdgLRevFLuC E6I/9BbP5SPOd/kTwFNdFZ0MLzb2KFGgCTW4NQ0PF7+tX1+87ewWElPOwWB1X5GJ7xvPYJ5m eostab6MeBkZsbG5jpesh1pyg== IronPort-HdrOrdr: A9a23:v/Q5haslfVVndjVnPNEMfCP87skDYNV00zEX/kB9WHVpmszxra 6TdZUgpHjJYVkqOE3I9ertBEDiewK5yXcW2/hzAV7KZmCP0wHEEGgL1/qG/9SKIUzDH4Bmup uIC5IOauHNMQ== X-IronPort-AV: E=Sophos;i="5.87,223,1631592000"; d="scan'208";a="57485307" From: Jane Malalane To: Xen-devel CC: Jane Malalane , Jan Beulich , Ian Jackson Subject: [PATCH] xen/cpufreq: Reset policy after enabling/disabling turbo status Date: Wed, 10 Nov 2021 09:19:35 +0000 Message-ID: <20211110091935.16906-1-jane.malalane@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Before, user would change turbo status but this had no effect: boolean was set but policy wasn't reevaluated. Policy must be reevaluated so that CPU frequency is chosen according to the turbo status and the current governor. Therefore, add __cpufreq_governor() in cpufreq_update_turbo(). Reported-by: Signed-off-by: --- CC: Jan Beulich CC: Ian Jackson --- Release rationale: Not taking this patch means that turbo status is misleading. Taking this patch is low-risk as it only uses a function that already exists and is already used for setting the chosen scaling governor. Essentially, this change is equivalent to running 'xenpm en/disable-turbo-mode' and, subsequently, running 'xenpm set-scaling-governor '. --- xen/drivers/cpufreq/utility.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/drivers/cpufreq/utility.c b/xen/drivers/cpufreq/utility.c index b93895d4dd..5f200ff3ee 100644 --- a/xen/drivers/cpufreq/utility.c +++ b/xen/drivers/cpufreq/utility.c @@ -417,10 +417,14 @@ int cpufreq_update_turbo(int cpuid, int new_state) { ret = cpufreq_driver.update(cpuid, policy); if (ret) + { policy->turbo = curr_state; + return ret; + } } - return ret; + /* Reevaluate current CPU policy. */ + return __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS); }