Skip to content

Track and expose idle PURR and SPURR ticks

Gautham R. Shenoy linuxppc-dev lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest5 patches 9 repliesIn review
  2. v46 patches 10 repliesSuperseded
  3. v36 patches 0 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v25 patches13 repliesSuperseded
v13 patches21 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5powerpc: Move idle_loop_prolog()/epilog() functions to header filearch/powerpc/include/asm/idle.h arch/powerpc/platforms/pseries/setup.c drivers/cpuidle/cpuidle-pseries.c+43 -311 reply
2/5powerpc/idle: Store PURR snapshot in a per-cpu global variablearch/powerpc/include/asm/idle.h arch/powerpc/platforms/pseries/setup.c drivers/cpuidle/cpuidle-pseries.c+31 -220 replies
3/5powerpc/pseries: Account for SPURR ticks on idle CPUsarch/powerpc/include/asm/idle.h arch/powerpc/platforms/pseries/setup.c+19 -00 replies
4/5powerpc/sysfs: Show idle_purr and idle_spurr for every CPUarch/powerpc/include/asm/idle.h arch/powerpc/kernel/sysfs.c+111 -30 replies
5/5Documentation: Document sysfs interfaces purr, spurr, idle_purr, idle_spurrDocumentation/ABI/testing/sysfs-devices-system-cpu+39 -00 replies

Reviews trailers per patch

None of the 5 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchNaveen N. RaoKamalesh BabulalTyrel DatwylerNathan Lynch
SeriesA-b Reviewed-and-Tested-by R-b A-b
1/5
2/5
3/5
4/5
5/5

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 v5 thread

Cover letter [PATCH v5 0/5] Track and expose idle PURR and SPURR ticks

From: "Gautham R. Shenoy" <[email protected]>

Hi,

This is the fifth version of the patches to track and expose idle PURR and SPURR ticks. These patches are required by tools such as lparstat to compute system utilization for capacity planning purposes.

The previous versions can be found here:
v4: https://lkml.org/lkml/2020/3/27/323
v3: https://lkml.org/lkml/2020/3/11/331
v2: https://lkml.org/lkml/2020/2/21/21
v1: https://lore.kernel.org/patchwork/cover/1159341/

They changes from v4 are:

- As suggested by Naveen, moved the functions read_this_idle_purr() and read_this_idle_spurr() from Patch 2 and Patch 3 respectively to Patch 4 where it is invoked.

- Dropped Patch 6 which cached the values of purr, spurr, idle_purr, idle_spurr in order to minimize the number of IPIs sent.

- Updated the dates for the idle_purr, idle_spurr in the Documentation Patch 5.

Motivation:
===========
On PSeries LPARs, the data centers planners desire a more accurate view of system utilization per resource such as CPU to plan the system capacity requirements better. Such accuracy can be obtained by reading PURR/SPURR registers for CPU resource utilization.

Tools such as lparstat which are used to compute the utilization need to know [S]PURR ticks when the cpu was busy or idle. The [S]PURR counters are already exposed through sysfs. We already account for PURR ticks when we go to idle so that we can update the VPA area. This patchset extends support to account for SPURR ticks when idle, and expose both via per-cpu sysfs files.

These patches are required for enhancement to the lparstat utility that compute the CPU utilization based on PURR and SPURR which can be found here :
https://groups.google.com/forum/#!topic/powerpc-utils-devel/fYRo69xO9r4

With the patches, when lparstat is run on a LPAR running CPU-Hogs,
=========================================================================
sudo ./src/lparstat -E 1 3

System Configuration
type=Dedicated mode=Capped smt=8 lcpu=2 mem=4834112 kB cpus=0 ent=2.00

---Actual--- -Normalized-
%busy %idle Frequency %busy %idle
------ ------ ------------- ------ ------

1  99.99   0.00  3.35GHz[111%] 110.99   0.00
2 100.00   0.00  3.35GHz[111%] 111.01   0.00
3 100.00   0.00  3.35GHz[111%] 111.00   0.00

With patches, when lparstat is run on and idle LPAR
=========================================================================
System Configuration
type=Dedicated mode=Capped smt=8 lcpu=2 mem=4834112 kB cpus=0 ent=2.00
---Actual--- -Normalized-
%busy %idle Frequency %busy %idle
------ ------ ------------- ------ ------

1   0.15  99.84  2.17GHz[ 72%]   0.11  71.89
2   0.24  99.76  2.11GHz[ 70%]   0.18  69.82
3   0.24  99.75  2.11GHz[ 70%]   0.18  69.81

Gautham R. Shenoy (5):
powerpc: Move idle_loop_prolog()/epilog() functions to header file powerpc/idle: Store PURR snapshot in a per-cpu global variable powerpc/pseries: Account for SPURR ticks on idle CPUs powerpc/sysfs: Show idle_purr and idle_spurr for every CPU
Documentation: Document sysfs interfaces purr, spurr, idle_purr,
idle_spurr

 Documentation/ABI/testing/sysfs-devices-system-cpu | 39 +++++++++
 arch/powerpc/include/asm/idle.h                    | 93 ++++++++++++++++++++++
 arch/powerpc/kernel/sysfs.c                        | 82 ++++++++++++++++++-
 arch/powerpc/platforms/pseries/setup.c             |  8 +-
 drivers/cpuidle/cpuidle-pseries.c                  | 39 ++-------
 5 files changed, 224 insertions(+), 37 deletions(-)
 create mode 100644 arch/powerpc/include/asm/idle.h
Signature · 1 line
1.9.4