Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5946556rwl; Thu, 29 Dec 2022 05:29:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXvuPViuc5idqbhjDJBrtR2LoHwMRSHc8IkefQ4X9ubmEhLkXkttd/h+bvcK1UUbbw0J3Y2J X-Received: by 2002:a05:6a21:2d05:b0:a7:92f2:9b65 with SMTP id tw5-20020a056a212d0500b000a792f29b65mr37208914pzb.59.1672320576747; Thu, 29 Dec 2022 05:29:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672320576; cv=none; d=google.com; s=arc-20160816; b=b277Tbob//vbhxN2LNxh//fTHI+VMJyb8OJfgilxbfEH2uSTib/UnutziNfRvVxE2O uadKIZ7l1ipZj91gOJKjgl2Rr5NO4GVdZyvmm8RD+xAJ7CCZN6HN4TxkwlMMQMJxJLOm pPw0V1WR9tWKi79+ziZUbCqxbiFnHAYeUTzmb3JUZoV1vmuV8Nm+w+qEogaIy73vf3FZ KETMCCrTSA2/+FsU6PZRbunlp8K0KLOQAAsg5vo4RSSjlECMFGcpCs1V4skj2caFTEZ0 iiztRA6trY0x895ouC3IeGD3MCWXOZadsqQ8u/VKR6n8P8Y6w+JSgTNaWvNhDy44m5f1 OTEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=fPipVc4z0gWEOJMhi7+Lql0b+KIlINn8rsi5K72nNU4=; b=omuptKQoC7BmwDOQPUPsmXO3fxerfZ0qQMJjvFe0oAkIAMZYx5LjT9krTzbqo0FFBK BTZlak34oostCnR3cCpKQj3jGVEMhtOX06O5bgnmZxu/cuKnw4UOwmAsD0AxJdTAhv1M BPl7R3S7nI96a6dAos3O7tEEk/Tvl+3aIy4qbLQYVTkklzls+LxYW2cS8k0bDrEhhWbF k5pggi+YakOZLABiVO+5KMLmyrZoM9YGZHLN0lpHaaulKFKAE/G2IECglzOarMEcwQN2 9TVsKnnLBOLMDysRNixkeLZLjvC6Tds5fMNigfexrnzut2p4ovnRHWehJ+0JyZtt+lFI 9RtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=ivk5BPlq; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u13-20020a056a00158d00b00581da546a3csi889668pfk.209.2022.12.29.05.29.28; Thu, 29 Dec 2022 05:29:36 -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; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=ivk5BPlq; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233217AbiL2M6l (ORCPT + 61 others); Thu, 29 Dec 2022 07:58:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229611AbiL2M6j (ORCPT ); Thu, 29 Dec 2022 07:58:39 -0500 Received: from smtp-fw-80006.amazon.com (smtp-fw-80006.amazon.com [99.78.197.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A38E613DE9; Thu, 29 Dec 2022 04:58:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1672318719; x=1703854719; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=fPipVc4z0gWEOJMhi7+Lql0b+KIlINn8rsi5K72nNU4=; b=ivk5BPlqnEWddg5acAzcTnHH1K+W/6wzAZPtFSgdy3psZmNR5SCs/8pg 1ruuq/VqT2Wan9d5wwFYOS3L8W7atHstEFewZxLvHi9/ub5XTzjVUMEBy DdpLtXGqKBFdVj4IYUZqKcPkbuPW60a3bT/7DxDIWUCogufMdF6d44go+ Y=; X-IronPort-AV: E=Sophos;i="5.96,284,1665446400"; d="scan'208";a="166123243" Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO email-inbound-relay-pdx-2b-m6i4x-26a610d2.us-west-2.amazon.com) ([10.25.36.210]) by smtp-border-fw-80006.pdx80.corp.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Dec 2022 12:58:37 +0000 Received: from EX13MTAUWB002.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-pdx-2b-m6i4x-26a610d2.us-west-2.amazon.com (Postfix) with ESMTPS id 6032441886; Thu, 29 Dec 2022 12:58:36 +0000 (UTC) Received: from EX19D024UWB003.ant.amazon.com (10.13.138.126) by EX13MTAUWB002.ant.amazon.com (10.43.161.202) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 29 Dec 2022 12:58:35 +0000 Received: from EX13MTAUWB001.ant.amazon.com (10.43.161.207) by EX19D024UWB003.ant.amazon.com (10.13.138.126) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1118.20; Thu, 29 Dec 2022 12:58:35 +0000 Received: from dev-dsk-ptyadav-1c-37607b33.eu-west-1.amazon.com (10.15.11.255) by mail-relay.amazon.com (10.43.161.249) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Thu, 29 Dec 2022 12:58:35 +0000 Received: by dev-dsk-ptyadav-1c-37607b33.eu-west-1.amazon.com (Postfix, from userid 23027615) id C228220D25; Thu, 29 Dec 2022 13:58:33 +0100 (CET) From: Pratyush Yadav To: "Rafael J. Wysocki" CC: Linux PM , LKML , Linux ACPI , Srinivas Pandruvada Subject: Re: [PATCH v2 1/3] ACPI: processor: perflib: Use the "no limit" frequency QoS References: <12138067.O9o76ZdvQC@kreacher> <12124970.O9o76ZdvQC@kreacher> Date: Thu, 29 Dec 2022 13:58:33 +0100 In-Reply-To: <12124970.O9o76ZdvQC@kreacher> (Rafael J. Wysocki's message of "Wed, 28 Dec 2022 22:21:49 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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 Rafael, On Wed, Dec 28 2022, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > When _PPC returns 0, it means that the CPU frequency is not limited by > the platform firmware, so make acpi_processor_get_platform_limit() > update the frequency QoS request used by it to "no limit" in that case. > > This addresses a problem with limiting CPU frequency artificially on > some systems after CPU offline/online to the frequency that corresponds > to the first entry in the _PSS return package. > > Reported-by: Pratyush Yadav > Signed-off-by: Rafael J. Wysocki > --- > > v1 -> v2: > * Move some changes into a separate patch > * Update the changelog accordingly > > --- > drivers/acpi/processor_perflib.c | 20 ++++++++++++++++---- > 1 file changed, 16 insertions(+), 4 deletions(-) > > Index: linux-pm/drivers/acpi/processor_perflib.c > =================================================================== > --- linux-pm.orig/drivers/acpi/processor_perflib.c > +++ linux-pm/drivers/acpi/processor_perflib.c > @@ -53,6 +53,8 @@ static int acpi_processor_get_platform_l > { > acpi_status status = 0; > unsigned long long ppc = 0; > + s32 qos_value; > + int index; > int ret; > > if (!pr) > @@ -72,17 +74,27 @@ static int acpi_processor_get_platform_l > } > } > > + index = ppc; > + > pr_debug("CPU %d: _PPC is %d - frequency %s limited\n", pr->id, > - (int)ppc, ppc ? "" : "not"); > + index, index ? "is" : "is not"); > > - pr->performance_platform_limit = (int)ppc; > + pr->performance_platform_limit = index; > > if (ppc >= pr->performance->state_count || > unlikely(!freq_qos_request_active(&pr->perflib_req))) > return 0; > > - ret = freq_qos_update_request(&pr->perflib_req, > - pr->performance->states[ppc].core_frequency * 1000); > + /* > + * If _PPC returns 0, it means that all of the available states can be > + * used ("no limit"). > + */ > + if (index == 0) > + qos_value = FREQ_QOS_MAX_DEFAULT_VALUE; One small thing I noticed: in acpi_processor_ppc_init() "no limit" value is set to INT_MAX and here it is set to FREQ_QOS_MAX_DEFAULT_VALUE. Both should evaluate to the same value but I think it would be nice if the same thing is used in both places. Perhaps you can fix that up when applying? Other than this, Reviewed-by: Pratyush Yadav Tested-by: Pratyush Yadav Thanks for working on this. > + else > + qos_value = pr->performance->states[index].core_frequency * 1000; > + > + ret = freq_qos_update_request(&pr->perflib_req, qos_value); > if (ret < 0) { > pr_warn("Failed to update perflib freq constraint: CPU%d (%d)\n", > pr->id, ret); > > > -- Regards, Pratyush Yadav Amazon Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B Sitz: Berlin Ust-ID: DE 289 237 879