From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 573CEFF8875 for ; Thu, 30 Apr 2026 10:01:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:CC:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WwwpkRJwkZezUuyadC6pFLx+PVDNGEiT19B/YITflFU=; b=2zdS7EtUcPZpD2IBXzxVRB+O7U V4m24/l3WnotvyY8hXgPo+YVEJrSa56xepuovbiaLT3CfOzKpOSn5tNvjgOPlKT6qW415G7FYQ4DL X1rgxMyKeTcJPnhEWBxCqjW7OBoXnZkjPzWQ44Q67brNPxyoVkgF0ysMz7dbf4YdzFtpO+3kS4gbL Flr6amBfHyW9IhIBCUs4XljmzmTggUAA287v91t13B7F6TXcEBuUfCF9yPj1az+IMukf11OGx1quN iMLXobH7p/U565CJ/6j2NYeC/DgU8imGVdMDo0KiRSnr4cFtiXHDq/uLRGVbpGA3J3paNFy56BDRs lhR7JZog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1wIOCX-000000059WN-18uQ; Thu, 30 Apr 2026 10:00:57 +0000 Received: from canpmsgout04.his.huawei.com ([113.46.200.219]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1wIOCP-000000059VP-49i2 for linux-arm-kernel@lists.infradead.org; Thu, 30 Apr 2026 10:00:55 +0000 dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=WwwpkRJwkZezUuyadC6pFLx+PVDNGEiT19B/YITflFU=; b=5DhB24bFvvGN0JfZCRxg/8DOOEZLKWNzogjjgdaQa8VOk03uLUKMMos83Kajwjd4ZU5THwYtA uyddoWHhasNOgtD+WczcsMc4G8ZfTnA8lDL7yaRL+u7hXJuYriJVl1f2MVvBug/e4KVITObXavG 7eEvBZ5yz0zJyoXGMkiQHyo= Received: from mail.maildlp.com (unknown [172.19.162.223]) by canpmsgout04.his.huawei.com (SkyGuard) with ESMTPS id 4g5qJR6Tmrz1prLm; Thu, 30 Apr 2026 17:54:15 +0800 (CST) Received: from kwepemr200004.china.huawei.com (unknown [7.202.195.241]) by mail.maildlp.com (Postfix) with ESMTPS id 27C3140561; Thu, 30 Apr 2026 18:00:46 +0800 (CST) Received: from [10.67.121.62] (10.67.121.62) by kwepemr200004.china.huawei.com (7.202.195.241) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 30 Apr 2026 18:00:45 +0800 Message-ID: Date: Thu, 30 Apr 2026 18:00:44 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/2] CPPC: reduce FFH feedback-counter sampling skew on arm64 To: , , , , , , , , , CC: , , , , , , , , , , , References: <20260410094145.4132082-1-zhangpengjie2@huawei.com> From: "zhangpengjie (A)" In-Reply-To: <20260410094145.4132082-1-zhangpengjie2@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.121.62] X-ClientProxiedBy: kwepems200001.china.huawei.com (7.221.188.67) To kwepemr200004.china.huawei.com (7.202.195.241) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260430_030051_253739_93E07608 X-CRM114-Status: GOOD ( 15.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi all, Gentle ping on this thread. It has been a while since I posted it. Could someone please take a look when you have time? If there is anything I should revise or any additional information needed, I'd be happy to update it. Thanks! On 4/10/2026 5:41 PM, Pengjie Zhang wrote: > The legacy CPPC feedback-counter path reads the delivered and reference > performance counters separately. > > On arm64 systems using AMU-backed CPPC FFH counters, each FFH read is > served through a cross-CPU counter read helper. Reading the counters > separately therefore widens the sampling window between them and can > skew the delivered/reference ratio used by cpuinfo_cur_freq. Under heavy > load, the skew is observable as transient values that may exceed the > platform maximum, as discussed in [1] and [2]. > > This series adds a small generic hook for architectures that can obtain > both FFH feedback counters in one operation, while preserving the > existing per-register read path as the fallback. > > Patch 1 adds the generic CPPC hook and uses it from cppc_get_perf_ctrs(). > Patch 2 implements the hook on arm64 by sampling both AMU counters in a > single operation on the target CPU. > > [1] https://lore.kernel.org/all/20231025093847.3740104-4-zengheng4@huawei.com/ > [2] https://lore.kernel.org/all/20231212072617.14756-1-lihuisong@huawei.com/ > > Signed-off-by: Pengjie Zhang > > Pengjie Zhang (2): > ACPI: CPPC: add paired FFH feedback-counter read hook > arm64: topology: read CPPC FFH feedback counters in one operation > > arch/arm64/kernel/topology.c | 75 ++++++++++++++++++++++++++++++++---- > drivers/acpi/cppc_acpi.c | 58 +++++++++++++++++++++++++--- > include/acpi/cppc_acpi.h | 7 ++++ > 3 files changed, 127 insertions(+), 13 deletions(-) >