mbox series

[RFC,0/2] Add support for DDR MPAM monitoring

Message ID 20230308134539.3071034-1-amitsinght@marvell.com (mailing list archive)
Headers show
Series Add support for DDR MPAM monitoring | expand

Message

Amit Singh Tomar March 8, 2023, 1:45 p.m. UTC
This patch-set aims to consolidate monitoring support for Memory bandwidth
monitors present on DDR MSC block. First patch (1/2) in the series is to
support a topology where bandwidth counters are enumerated as part of "MB"
resource (in other words, when these bandwidth counter are hosted by DDR MSC block).
Expecting comments on x86 part, how it would be handled for both x86 and
ARM64?
Second patch (2/2) adds support for long version of MBWU registers MSMON_MBWU_L, and
MSMON_MBWU_CAPTURE_L.

Patches are lightly tested on internal emulator platform, for instance after
applying the patch (1/2) a new file "mbm_total_bytes" is created under resctrl file system,
it contains DDR bandwidth utilization in terms of bytes transferred.

#:/sys/fs/resctrl/p80$ tree
tree
.

 cpus

 cpus_list

 id

 mode

 mon_data

    mon_L3_00

       llc_occupancy

    mon_MB_00

        mbm_total_bytes

 mon_groups

 schemata

 size

 tasks


4 directories, 9 files

Also, run lmbench's bw_mem (read and write) , and compared the content of "mbm_total_bytes" with raw counters read using devmem that is kind of matching.

#:/lmbench$  cat /sys/fs/resctrl/mon_data/mon_MB_00/mbm_total_bytes
4426496 -> with 4 DDR Channel enabled
odyssey:/lmbench$ devmem 0x87E1B0240880 32
0x00115B40 --> 1137472*4 = 4549888

TODO:
     * Test these bandwidth monitors with perf utility with different partID's
     * Test with PMG other than default.
     * Test the counters overflow condition.
     * Test it on numa multisocket platform.

Amit Singh Tomar (2):
  arm_mpam: resctrl: Add support for mbm total
  arm_mpam: add support for MSMON_MBWU_L/CAPTURE

 drivers/perf/resctrl_pmu.c            |  1 +
 drivers/platform/mpam/mpam_devices.c  | 54 +++++++++++++++++++++++----
 drivers/platform/mpam/mpam_internal.h | 15 ++++++--
 drivers/platform/mpam/mpam_resctrl.c  | 35 ++++++++++++++++-
 fs/resctrl/monitor.c                  | 28 ++++++++------
 include/linux/arm_mpam.h              |  7 +---
 6 files changed, 112 insertions(+), 28 deletions(-)