[PATCH 0/2] CPPC: reduce FFH feedback-counter sampling skew on arm64
Sumit Gupta
sumitg at nvidia.com
Mon Jun 29 08:54:47 PDT 2026
On 10/04/26 15:11, Pengjie Zhang wrote:
> External email: Use caution opening links or attachments
>
>
> 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 <zhangpengjie2 at huawei.com>
>
> 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(-)
>
> --
Hi Pengjie,
Thanks for the patches.
The series looks good to me, and it fixes the cpuinfo_cur_freq
spikes on an NVIDIA Vera (FFH) platform.
Just one nit on patch 2 (counter read order), noted there.
Tested-by: Sumit Gupta <sumitg at nvidia.com>
Reviewed-by: Sumit Gupta <sumitg at nvidia.com>
Thanks,
Sumit
More information about the linux-arm-kernel
mailing list