Received: by 2002:a05:6359:322:b0:b3:69d0:12d8 with SMTP id ef34csp325469rwb; Wed, 10 Aug 2022 08:52:59 -0700 (PDT) X-Google-Smtp-Source: AA6agR4HO1eap/IALiVmD+9+js6XoSdqMeB1XRKP4kqrR/CCY4z7KKXR7N7rT/6ri7/mfuMYbRQo X-Received: by 2002:a17:90b:4c07:b0:1f5:40a:8040 with SMTP id na7-20020a17090b4c0700b001f5040a8040mr4343466pjb.121.1660146779573; Wed, 10 Aug 2022 08:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660146779; cv=none; d=google.com; s=arc-20160816; b=c/yWybwXeIj4x97CYwKFWzn0hT/t815yyYgAKrwf+DXs6Nat6CTIMTwX3OiC/yPVyS PlVJjdiJm1QpG3s//fSNAw5hX7lAky+0mfL9/JnjtRdJdA7d4PXFo6w28iWpOwuLXr87 N+2WPa/0yGOEf98shF+ymxE6EuiBqANcNFnlSP1BjRpVwVJfewQr3AHJ2T/JMxwAjjIV mL7gkPAwEoR/L/foNXVcdjZCSZ9RgvcLfIyT1l+N5sxQGXDlxc98xKstiCS5IsFROPXc h41blUbVSwrASQZVLYXux0JB73eieM2p13qDkF0/BaRUXhxLLUhFsNOB3Nuk/FUSakJX 0y3w== 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=B140uv+U/BNMy5PjL1fTLH+eIKNiy2+FGaan2chKW3A=; b=QTvEgpiLvyGfnp7vrR2rmWpXzrJ9AHZhK5NXfMswRCtbQ+j6/M+i/04DPKMFxlAZHf 2Dn04KNn13Knce9D66gUBrzxB1RTX6fPdELCJv5Rj2Tj57saTaKkVis1iecom92zUd4U eaSP1jjMpwarFYMrPBP2qT30aLLXAoHiwl/9Fki15VUXmIrbp70MOpjLnTqA1T53crkR KAGddFIwWgd/SYZdAEf4NWQH6OYa4tBWqu3Mu7Xm9Oqf9c+DsQNZjImVH9qz2AEfPoGO 8E0XGcVWW0Z7TPhAvREloDpg8Lyp/oSxVPSFvbafg7okEh0Z+JvsxUduvkJedufKfgBK Oyyg== 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 u22-20020a63ef16000000b0041cc1c31173si17003414pgh.286.2022.08.10.08.52.44; Wed, 10 Aug 2022 08:52:59 -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 S231174AbiHJPcI (ORCPT + 99 others); Wed, 10 Aug 2022 11:32:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229924AbiHJPcH (ORCPT ); Wed, 10 Aug 2022 11:32:07 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EB455658C; Wed, 10 Aug 2022 08:32:04 -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 6E00A1424; Wed, 10 Aug 2022 08:32:05 -0700 (PDT) Received: from [10.57.42.77] (unknown [10.57.42.77]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 73B813F67D; Wed, 10 Aug 2022 08:32:02 -0700 (PDT) Message-ID: <2d0fc5d7-d484-f64c-fe50-18d18ad95fa2@arm.com> Date: Wed, 10 Aug 2022 17:32:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v2 1/1] ACPI: CPPC: Disable FIE if registers in PCC regions Content-Language: en-US To: Lukasz Luba , Jeremy Linton Cc: 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, linux-pm@vger.kernel.org, vschneid@redhat.com, Ionela Voinescu , Dietmar Eggemann References: <20220728221043.4161903-1-jeremy.linton@arm.com> <20220728221043.4161903-2-jeremy.linton@arm.com> <3a5e7abd-9361-11ba-978d-8e8bae00ea31@arm.com> <4da7cd19-4b98-9360-922f-d625c4ec55e0@arm.com> From: Pierre Gondois In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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,T_SCC_BODY_TEXT_LINE 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 On 8/10/22 16:37, Lukasz Luba wrote: > > > On 8/10/22 15:30, Jeremy Linton wrote: >> Hi, >> >> On 8/10/22 07:29, Lukasz Luba wrote: >>> Hi Jeremy, >>> >>> +CC Valentin since he might be interested in this finding >>> +CC Ionela, Dietmar >>> >>> I have a few comments for this patch. >>> >>> >>> On 7/28/22 23:10, Jeremy Linton wrote: >>>> 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(-) >>> >>> >>> 1. You assume that all platforms would have this big overhead when >>>     they have the PCC regions for this purpose. >>>     Do we know which version of HW mailbox have been implemented >>>     and used that have this 2-11% overhead in a platform? >>>     Do also more recent MHU have such issues, so we could block >>>     them by default (like in your code)? >> >> I posted that other email before being awake and conflated MHU with AMU >> (which could potentially expose the values directly). But the CPPC code >> isn't aware of whether a MHU or some other mailbox is in use. Either >> way, its hard to imagine a general mailbox with a doorbell/wait for >> completion handshake will ever be fast enough to consider running at the >> granularity this code is running at. If there were a case like that, the >> kernel would have to benchmark it at runtime to differentiate it from >> something that is talking over a slow link to a slowly responding mgmt >> processor. > > Exactly, I'm afraid the same, that we would never get such fast > mailbox-based platform. Newer platforms would just use AMU, so > completely different code and no one would even bother to test if > their HW mailbox is fast-enough for this FIE purpose ;) To add some platform information, the following platforms are using CPPC through PCC channels (so mailboxes): - Cavium ThunderX2 - Ampere eMAG - Ampere Altra Fwiw, I can confirm the cppc_fie kthread can represent a significant load, with a utilization between 2% and 30%. Regards, Pierre