Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp339168imn; Fri, 29 Jul 2022 08:24:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vDaKZcWonB/B8eZkJGW1vmLKITVz9fuHA+7bF7wcD4AElQ5/G4tGR6vB60/XbfvUXhDaDc X-Received: by 2002:a05:6402:1d53:b0:43b:e662:9fe7 with SMTP id dz19-20020a0564021d5300b0043be6629fe7mr4016972edb.168.1659108246859; Fri, 29 Jul 2022 08:24:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659108246; cv=none; d=google.com; s=arc-20160816; b=h8pUyyzWN3tnBwvOYziA3ydf27LQQ/+dhA3UM5Vs6Yf8yZ6JlgoMBy6NcVIhJqlKH4 DmajQVHawQvWAVY9bSPSdGR9qEJflnOMJkNwFzHqUHra+CQkAqLFwzNdFqrETyhf/LNK vvHpf68VGIt2nHN5GHky0mlxJcBopA9xXzNFyQJuWLmtxI8zHEv26WeQtcm4akw98xUE P6D4HoLMPSbFdb2LkV0Nhxl6mpwnmioxB+A2pV1VbpXrfzNexuA/A7sxHlSNXEz6kp1z lJh1+66W3OZmdpdLBkAvY7ZNzzne5mvExHIYVgrCFyNu5Zlz3I0jnyXQ1YvXjoc/OeZn KFhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=qwdfhUfUv0G6mYnQcpXQL37Ilq87As6znWFdkungr/0=; b=qL+iyyqBjZR1ae9vSMZ02RPt2tCdrl/sP2ILU3VOWiS9IlD1ZsDouUKm927csJ6ZzR R1G3xYPQyea6z0HSrW0ssdW27kiEapMXaP0XZBU+xvAtlfalr7pe9T56PKOVAOrkB5wI bNIjdBeOuyzaWnXrULu6wUsZ0ufbdJd7YvkDG2lv2Ci8UZzV+5G43wGbETqvQ5VLkuGr PsxTIaPhsRBz37HQWB2W0njlntOZAHEEuFBkhzYIrX17wSnkD4KOF4BRjwmuQuQMEaaA Lfpg7smFJT1QWKRMuE0F8wxgWpOFcwYKlYb9sgWng3lHgxPd9Uc7gPCtN44UNHg1Ob7h CoIg== 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 i9-20020a1709064fc900b00722e85dcd91si4255527ejw.175.2022.07.29.08.23.41; Fri, 29 Jul 2022 08:24:06 -0700 (PDT) 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 S237429AbiG2PVU (ORCPT + 99 others); Fri, 29 Jul 2022 11:21:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237401AbiG2PUx (ORCPT ); Fri, 29 Jul 2022 11:20:53 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1858F82FA0; Fri, 29 Jul 2022 08:20:48 -0700 (PDT) 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 4275B1063; Fri, 29 Jul 2022 08:20:48 -0700 (PDT) Received: from [192.168.122.164] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 53E383F73B; Fri, 29 Jul 2022 08:20:47 -0700 (PDT) Message-ID: Date: Fri, 29 Jul 2022 10:20:46 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v2 1/1] ACPI: CPPC: Disable FIE if registers in PCC regions Content-Language: en-US To: Punit Agrawal Cc: linux-pm@vger.kernel.org, rafael@kernel.org, lenb@kernel.org, viresh.kumar@linaro.org, robert.moore@intel.com, devel@acpica.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220728221043.4161903-1-jeremy.linton@arm.com> <20220728221043.4161903-2-jeremy.linton@arm.com> <871qu4krb4.fsf@stealth> From: Jeremy Linton In-Reply-To: <871qu4krb4.fsf@stealth> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,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, On 7/29/22 07:59, Punit Agrawal wrote: > Hi Jeremy, > > One comment / query below. > > Jeremy Linton writes: > >> PCC regions utilize a mailbox to set/retrieve register values used by >> the CPPC code. This is fine as long as the operations are >> infrequent. With the FIE code enabled though the overhead can range >> from 2-11% of system CPU overhead (ex: as measured by top) on Arm >> based machines. >> >> So, before enabling FIE assure none of the registers used by >> cppc_get_perf_ctrs() are in the PCC region. Furthermore lets also >> enable a module parameter which can also disable it at boot or module >> reload. >> >> Signed-off-by: Jeremy Linton >> --- >> drivers/acpi/cppc_acpi.c | 41 ++++++++++++++++++++++++++++++++++ >> drivers/cpufreq/cppc_cpufreq.c | 19 ++++++++++++---- >> include/acpi/cppc_acpi.h | 5 +++++ >> 3 files changed, 61 insertions(+), 4 deletions(-) >> > > [...] > >> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c >> index 24eaf0ec344d..ed607e27d6bb 100644 >> --- a/drivers/cpufreq/cppc_cpufreq.c >> +++ b/drivers/cpufreq/cppc_cpufreq.c > > [...] > >> @@ -229,7 +233,12 @@ static void __init cppc_freq_invariance_init(void) >> }; >> int ret; >> >> - if (cppc_cpufreq_driver.get == hisi_cppc_cpufreq_get_rate) >> + if (cppc_perf_ctrs_in_pcc()) { >> + pr_debug("FIE not enabled on systems with registers in PCC\n"); > > The message should probably be promoted to a pr_info() and exposed as > part of the kernel logs. It is a change in the default behaviour we've > had until now. The message will provide some hint about why it was > disabled. > > Thoughts? I personally flip flopped between making it pr_info or pr_debug and settled on debug because no one else was complaining about the cppc_fie consumption. Which to me, meant that the users of platforms utilizing PCC regions weren't sensitive to the problem, or weren't yet running a distro/kernel with it enabled, or any number of other reasons why the problem wasn't getting more attention. Mostly I concluded the FIE code hadn't shown up in "enterprise" distros yet.. But, yah, if no one is going to complain about the extra messages pr_info() is a better plan. Thanks for looking at this!