Re: [PATCH 0/2] CPPC: reduce FFH feedback-counter sampling skew on arm64

Will Deacon <[email protected]> Tue, 19 May 2026 11:47:48 +0100
Newsgroups dev.linux.lists.acpica-devel,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-acpi,org.kernel.vger.linux-kernel
Message-ID <agw_1IYaY4zeobZE@willie-the-truck>
On Thu, Apr 30, 2026 at 06:00:44PM +0800, zhangpengjie (A) wrote:
> 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.

It's hard to find active folks who have contributed meaningfully to the
cppc_acpi driver... I've added Ionella and Jeremy, in case they can take
a look.

Will

> 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/[email protected]/
> > [2] https://lore.kernel.org/all/[email protected]/
> > 
> > Signed-off-by: Pengjie Zhang <[email protected]>
> > 
> > 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(-)
> >