mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC PATCH 00/10] arm_mpam: Add extra MPAM controls in resctrl
@ 2026-10-23  2:48 Jinjie Ruan
  2026-10-23  2:48 ` [RFC PATCH 01/10] arm_mpam: Treat adopting a config feature as a change Jinjie Ruan
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Jinjie Ruan @ 2026-10-23  2:48 UTC (permalink / raw)
  To: james.morse, ben.horgan, reinette.chatre, fenghuay, tony.luck,
	Dave.Martin, babu.moger, x86, linux-kernel
  Cc: ruanjinjie

Hi all,

Resctrl today only exposes CBM and the MBA bandwidth percentage.
But MPAM MSCs also have per-PARTID fields for internal priority, capacity
limits, a bandwidth minimum and the MBW_MAX hard-limit bit. The driver
already writes these fields, but resctrl has no schemata line for them,
so userspace can't choose the values.

So this series adds those schemata lines:

- Patch 1 fixes maybe_update_config(): a feature set with value zero
  counts as no change, so the register is not written again.
  The controls below can be zero, so this comes first.

- Patches 2-4 add mbw_min/max_limit, cmax/cmin and intpri to
  mpam_config and write them from mpam_reprogram_ris_partid().

- Patch 5 adds the resource levels, selects the range path by schema_fmt
  instead of the MBA/SMBA rid, skips the new resources in info/, and sets
  their default value when a group is created.

- Patches 6-7 adjust the fixed-point helpers and clamp cmax_wd.

- Patches 8-10 add the schemata lines:

  L2MAX/L3MAX       CMAX, percent
  L2MIN/L3MIN       CMIN, percent
  MBMIN             MBW_MIN, percent
  L2PRI/L3PRI/MBPRI INTPRI, raw value
  MBHDL             HARDLIM, 0 or 1
  MBOPT             MBW_MAX, raw fraction

The new resources reuse the class, domains and components of L2/L3/MB; only
the mpam_config field written differs. MBOPT and MBA both write MBW_MAX.

So before this series userspace can only set CBM and the MBA percentage.
After it, you can do:

  # echo "L3MAX:33751040=50" > schemata
  # echo "MBHDL:33751040=1" > schemata

A new group starts from each resource's default value, so the new controls
stay out of the way until schemata is written.

Tested this with a QEMU that has one L2 MSC, one L3 MSC and one
memory-controller MSC (CMAX_WD 4, INTPRI_WD 2, BWA_WD 16). The guest writes
every new line and reads it back, for example:

  WRITE-OK   [L3MAX:33751040=50]
  SCHEMATA: L3MAX:33751040=50

Then reads the MSC registers:

  L3 MSC  partid0: PRI(IN)=2  CMIN=0x3000  CMAX=0x7000
  mem MSC partid0: PRI(IN)=1  MBW_MIN=0x3fff  MBW_MAX=0x1fff  HARDLIM=Y

CMIN/CMAX are 4-bit fractions (3/16 for 25%, 7/16 for 50%); MBW_MIN is a
16-bit fraction (0x3fff for 25%); MBOPT writes the raw fraction (8191).

QEMU branch: https://github.com/ruanjinjie-eng/qemu/tree/mpam
Test cases: https://github.com/ruanjinjie-eng/mpam_testcase

This series is also available at:
	https://github.com/ruanjinjie-eng/linux/tree/mpam-extra-controls

Jinjie Ruan (10):
  arm_mpam: Treat adopting a config feature as a change
  arm_mpam: Carry mbw_min and the hard limit in mpam_config
  arm_mpam: Carry cmax and cmin in mpam_config
  arm_mpam: Carry intpri in mpam_config
  fs/resctrl: Prepare for range-format pseudo resources
  arm_mpam: Clamp cmax_wd to 16
  arm_mpam: Generalize the fixed-point conversion helpers
  arm_mpam: resctrl: Expose the capacity controls as pseudo resources
  arm_mpam: resctrl: Expose the priority controls as pseudo resources
  arm_mpam: resctrl: Expose the bandwidth minimum and limit as pseudo
    resources

 drivers/resctrl/mpam_devices.c  |  59 +++++++--
 drivers/resctrl/mpam_internal.h |   8 ++
 drivers/resctrl/mpam_resctrl.c  | 215 +++++++++++++++++++++++++++++++-
 fs/resctrl/rdtgroup.c           |  15 ++-
 include/linux/resctrl.h         |  33 ++++-
 5 files changed, 307 insertions(+), 23 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-10-23 15:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-23  2:48 [RFC PATCH 00/10] arm_mpam: Add extra MPAM controls in resctrl Jinjie Ruan
2026-10-23  2:48 ` [RFC PATCH 01/10] arm_mpam: Treat adopting a config feature as a change Jinjie Ruan
2026-10-23  2:48 ` [RFC PATCH 02/10] arm_mpam: Carry mbw_min and the hard limit in mpam_config Jinjie Ruan
2026-10-23  2:48 ` [RFC PATCH 03/10] arm_mpam: Carry cmax and cmin " Jinjie Ruan
2026-10-23  2:48 ` [RFC PATCH 04/10] arm_mpam: Carry intpri " Jinjie Ruan
2026-10-23  2:48 ` [RFC PATCH 05/10] fs/resctrl: Prepare for range-format pseudo resources Jinjie Ruan
2026-10-23  2:48 ` [RFC PATCH 06/10] arm_mpam: Clamp cmax_wd to 16 Jinjie Ruan
2026-10-23  2:48 ` [RFC PATCH 07/10] arm_mpam: Generalize the fixed-point conversion helpers Jinjie Ruan
2026-10-23  2:48 ` [RFC PATCH 08/10] arm_mpam: resctrl: Expose the capacity controls as pseudo resources Jinjie Ruan
2026-10-23  2:48 ` [RFC PATCH 09/10] arm_mpam: resctrl: Expose the priority " Jinjie Ruan
2026-10-23  2:48 ` [RFC PATCH 10/10] arm_mpam: resctrl: Expose the bandwidth minimum and limit " Jinjie Ruan
2026-10-23 15:11 ` [RFC PATCH 00/10] arm_mpam: Add extra MPAM controls in resctrl Reinette Chatre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®