Skip to content

x86/cpu: Consolidate APERF/MPERF code

Thomas Gleixner linux-pm lkml 1 version Applied

Status from this message: The following commit has been merged into the x86/cleanups branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 21 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/10x86/aperfmperf: Dont wake idle CPUs in arch_freq_get_on_cpu()arch/x86/kernel/cpu/aperfmperf.c+3 -01 reply
2/10x86/smp: Move APERF/MPERF code where it belongsarch/x86/kernel/cpu/aperfmperf.c arch/x86/kernel/smpboot.c+362 -3591 reply
3/10x86/aperfmperf: Separate AP/BP frequency invariance initarch/x86/include/asm/topology.h arch/x86/kernel/acpi/cppc.c arch/x86/kernel/cpu/aperfmperf.c +1 more+20 -221 reply
4/10x86/aperfmperf: Untangle Intel and AMD frequency invariance initarch/x86/include/asm/topology.h arch/x86/kernel/acpi/cppc.c arch/x86/kernel/cpu/aperfmperf.c +1 more+49 -571 reply
5/10x86/aperfmperf: Put frequency invariance aperf/mperf data into a structarch/x86/kernel/cpu/aperfmperf.c+15 -111 reply
6/10x86/aperfmperf: Restructure arch_scale_freq_tick()arch/x86/kernel/cpu/aperfmperf.c+21 -151 reply
7/10x86/aperfmperf: Make parts of the frequency invariance code unconditionalarch/x86/include/asm/cpu.h arch/x86/include/asm/topology.h arch/x86/kernel/cpu/aperfmperf.c +1 more+41 -311 reply
8/10x86/aperfmperf: Store aperf/mperf data for cpu frequency readsarch/x86/kernel/cpu/aperfmperf.c+13 -11 reply
9/10x86/aperfmperf: Replace aperfmperf_get_khz()arch/x86/kernel/cpu/aperfmperf.c fs/proc/cpuinfo.c include/linux/cpufreq.h+35 -491 reply
10/10x86/aperfmperf: Replace arch_freq_get_on_cpu()arch/x86/kernel/cpu/aperfmperf.c arch/x86/kernel/cpu/proc.c+2 -941 reply

Reviews trailers per patch

All 10 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchRafael J. WysockiPeter Zijlstra (Intel)Eric DumazetPaul E. McKenney
SeriesA-b T-b A-b
1/10A-b
2/10A-b
3/10R-b
4/10R-b
5/10R-b
6/10R-b
7/10R-b
8/10A-b
9/10R-b
10/10R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [patch 00/10] x86/cpu: Consolidate APERF/MPERF code

APERF/MPERF is utilized in two ways:

1) Ad hoc readout of CPU frequency which requires IPIs

2) Frequency scale calculation for frequency invariant scheduling which reads APERF/MPERF on every tick.

These are completely independent code parts. Eric observed long latencies when reading /proc/cpuinfo which reads out CPU frequency via #1 and proposed to replace the per CPU single IPI with a broadcast IPI.

While this makes the latency smaller, it is not necessary at all because #2 samples APERF/MPERF periodically, except on idle or isolated NOHZ full CPUs which are excluded from IPI already.

It could be argued that not all APERF/MPERF capable systems have the required BIOS information to enable frequency invariance support, but in practice most of them do. So the APERF/MPERF sampling can be made unconditional and just the frequency scale calculation for the scheduler excluded.

The following series consolidates that.

Thanks,

tglx

---
 arch/x86/include/asm/cpu.h       |    2 
 arch/x86/include/asm/topology.h  |   17 -
 arch/x86/kernel/acpi/cppc.c      |   28 --
 arch/x86/kernel/cpu/aperfmperf.c |  474 +++++++++++++++++++++++++++++++--------
 arch/x86/kernel/cpu/proc.c       |    2 
 arch/x86/kernel/smpboot.c        |  358 -----------------------------
 fs/proc/cpuinfo.c                |    6 
 include/linux/cpufreq.h          |    1 
 8 files changed, 405 insertions(+), 483 deletions(-)