Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6379921rwl; Thu, 29 Dec 2022 11:46:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXv5K9cSsP5ClBJfg4NYIdlSo+2BpzUQ6xI0eXyBMYr30bX4IoW3lS5PYuSDPg7sHL82b45A X-Received: by 2002:a17:906:cd1a:b0:801:d0bc:f616 with SMTP id oz26-20020a170906cd1a00b00801d0bcf616mr35191339ejb.62.1672343219651; Thu, 29 Dec 2022 11:46:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672343219; cv=none; d=google.com; s=arc-20160816; b=FSMNnqWfpIDKoGFBZKnOH32J3hdixMfCGrGCQv4xUISW3RcnUJcphadWuukT8c+qRv JuflXLQK7A5x66U9kA+GTyiqSq1qcYeAQpruONsNmjKjetHZjGYtF+HQ6wgSxng6JANe B6/LGVlUV0Odd2MnNAdAQzN0E04V/vi1NMi4sDxW6QbCqsURJR4jmtuAIvNrk+GAPzDy qxOpbIwBwyuRy5EyGz314bnJX5oIAxcyOC735z0yABZ+PiqsTNJWSsCGVnCX21M3tQJr rhK67nHzj+mePtPcdcXcLXJBl1OFBwO7ArxopAogW9V7OMw9JwVIEFPxGdvljyy/D8ps YiOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=96swl6SBp+iRyjcWKsO/bgYdGhEEyZ7jRkRVKCzJmJk=; b=bjj8lLrkSuOkjltZLw9HOc95pqOzyKNNmIXf1J741VRkLhNpm7zsXiYul2uuTrrt0A XWSbzwyt66157zopqFJk8Ay4W2RK9Bn5DCvu8/hLBPr7aE2BWM0pTEzuv6tTE2blGZUp FWuwBn2ePyXloP8xK692ZPuuP/fczDzScKRyLVqySgTFqABS65H+LiSN6vfVNysWg7eE ETaaLoaUqmCyWllxEHixG7Hmoo5q6nqtrP6DhQuGXbpGEYCU/tTIoiGj3LsRA3G/jUfg LVgdHOkeZJRTI6etlyDb7Tg63ds5phqsN38PTqRDrL17l6WUyPjS8uCS3p1FKSTdU/S2 ++kA== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw9-20020a170906478900b007aeaacd5592si16269653ejc.124.2022.12.29.11.46.37; Thu, 29 Dec 2022 11:46:59 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230458AbiL2T0X (ORCPT + 62 others); Thu, 29 Dec 2022 14:26:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbiL2T0V (ORCPT ); Thu, 29 Dec 2022 14:26:21 -0500 Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0304312AA2; Thu, 29 Dec 2022 11:26:21 -0800 (PST) Received: by mail-io1-f49.google.com with SMTP id i83so10120044ioa.11; Thu, 29 Dec 2022 11:26:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=96swl6SBp+iRyjcWKsO/bgYdGhEEyZ7jRkRVKCzJmJk=; b=fdKTNdPVOBepco6nv3uEAsCFFERupaUvDVX858ZK91t7Oe34XK0hduVhMLW21VH+4D aBUI/MQQUXloczNZMU7gsBR83VMWZYe1DEaF7GOaRn4fOeH5T6N2uv0OhiDBWIkLVjqd RVTLs3sHJ1NmoOt+E9xhRB3VLFwttodRyzgRgPXkbnaaG7Q51aIczZJI/0j5Fk3nubyp WPX71UzviJpxrNtvYQC0shFM4Zx/oT5uUQIkXEIVDCamkRbRoubS6fdWzJ7iELkVHKGd jCrbpehXVJ41wLmrcHU/PoeiLm0XQZf1OEGs5hE6zseRx160AqJqJFD36jtzaRcqGNb1 KyKg== X-Gm-Message-State: AFqh2koAOgCpK3ZaYzWwsp0fR28ZaFgMHFrPc+cXhQzaEOqVfnzwYsLU qjCgN7heGkB3aJHHqf2FTy9obMgiXJxx6FZhd88= X-Received: by 2002:a02:9707:0:b0:396:2348:340e with SMTP id x7-20020a029707000000b003962348340emr2793714jai.195.1672341980204; Thu, 29 Dec 2022 11:26:20 -0800 (PST) MIME-Version: 1.0 References: <12138067.O9o76ZdvQC@kreacher> <12124970.O9o76ZdvQC@kreacher> In-Reply-To: From: "Rafael J. Wysocki" Date: Thu, 29 Dec 2022 20:26:07 +0100 Message-ID: Subject: Re: [PATCH v2 1/3] ACPI: processor: perflib: Use the "no limit" frequency QoS To: Pratyush Yadav Cc: "Rafael J. Wysocki" , Linux PM , LKML , Linux ACPI , Srinivas Pandruvada Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no 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 On Thu, Dec 29, 2022 at 1:58 PM Pratyush Yadav wrote: > > 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? Yes, I'll do that. > Other than this, > > Reviewed-by: Pratyush Yadav > Tested-by: Pratyush Yadav Thanks! > Thanks for working on this. You're welcome.