mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/9] arm_mpam: Introduce Narrow-PARTID feature
@ 2026-03-17 13:21 Zeng Heng
  2026-03-17 13:21 ` [PATCH v3 1/9] fs/resctrl: Fix MPAM Partid parsing errors by preserving CDP state during umount Zeng Heng
                   ` (10 more replies)
  0 siblings, 11 replies; 22+ messages in thread
From: Zeng Heng @ 2026-03-17 13:21 UTC (permalink / raw)
  To: ben.horgan, james.morse, Dave.Martin, reinette.chatre, fenghuay
  Cc: dave.hansen, tglx, mingo, hpa, bp, tony.luck, babu.moger, x86,
	linux-kernel, wangkefeng.wang

This series applies on top of the mpam_resctrl_glue_v5_debugfs branch of:
https://gitlab.arm.com/linux-arm/linux-bh.git

Background
==========

On x86, the resctrl allows creating up to num_rmids monitoring groups
under parent control group. However, ARM64 MPAM is currently limited by
the PMG (Performance Monitoring Group) count, which is typically much
smaller than the theoretical RMID limit. This creates a significant
scalability gap: users expecting fine-grained per-process or per-thread
monitoring quickly exhaust the PMG space, even when plenty of reqPARTIDs
remain available.

The Narrow-PARTID feature, defined in the ARM MPAM architecture,
addresses this by associating reqPARTIDs with intPARTIDs through a
programmable many-to-one mapping. This allows the kernel to present more
logical monitoring contexts.

Design Overview
===============

The implementation extends the RMID encoding to carry reqPARTID
information:

  RMID = reqPARTID * NUM_PMG + PMG

In this patchset, a monitoring group is uniquely identified by the
combination of reqPARTID and PMG. The closid is represented by intPARTID,
which is exactly the original PARTID.

For systems with homogeneous MSCs (all supporting Narrow-PARTID), the
driver exposes the full reqPARTID range directly. For heterogeneous
systems where some MSCs lack Narrow-PARTID support, the driver utilizes
PARTIDs beyond the intPARTID range as reqPARTIDs to expand monitoring
capacity. The sole exception is when MBA MSCs lack Narrow-PARTID support,
their percentage-based control mechanism prevents the use of PARTIDs as
reqPARTIDs.

Capacity Improvements
=====================

--------------------------------------------------------------------------
The maximum        |  Sub-monitoring groups            | System-wide
number of          |  under a control group            | monitoring groups
--------------------------------------------------------------------------
Without            |                                   |
reqPARTID          |  PMG                              | intPARTID * PMG
--------------------------------------------------------------------------
reqPARTID          |                                   |
static allocation  | (reqPARTID // intPARTID) * PMG    | reqPARTID * PMG
--------------------------------------------------------------------------
reqPARTID          |                                   |
dynamic allocation | (reqPARTID − intPARTID + 1) * PMG | reqPARTID * PMG
--------------------------------------------------------------------------

Under MPAM, the number of reqPARTID is always greater than or equal to
intPARTID.

Series Structure
================

Patch 1: Fix pre-existing out-of-range PARTID issue between mount sessions.
Patches 2-5: Implement static reqPARTID allocation.
Patches 6-9: Implement dynamic reqPARTID allocation.

---
Compared with v2:
  - Add dynamic reqPARTID allocation implementation.
  - Add Patch 1 to fix pre-existing out-of-range PARTID issue.
  - Drop original patch 4 which has been merged into the baseline.

Compared with v1:
  - Redefine the RMID information.
  - Refactor the resctrl_arch_rmid_idx_decode() and
    resctrl_arch_rmid_idx_encode().
  - Simplify closid_rmid2reqpartid() to rmid2reqpartid() and replace it
    accordingly.

Compared with RFC-v4:
  - Rebase the patch set on the v6.14-rc1 branch.

Compared with RFC-v3:
  - Add limitation of the Narrow-PARTID feature (See Patch 2).
  - Remove redundant reqpartid2closid() and reqpartid_pmg2rmid().
  - Refactor closid_rmid2reqpartid() partially.
  - Merge the PARTID conversion-related patches into a single patch for
    bisectability.
  - Skip adaptation of resctrl_arch_set_rmid() which is going to be
    removed.

Compared with RFC-v2:
  - Refactor closid/rmid pair translation.
  - Simplify the logic of synchronize configuration.
  - Remove reqPARTID source bitmap.

Compared with RFC-v1:
  - Rebase this patch set on latest MPAM driver of the v6.12-rc1 branch.

    v2: https://lore.kernel.org/all/20250222112448.2438586-1-zengheng4@huawei.com/
    v1: https://lore.kernel.org/all/20250217031852.2014939-1-zengheng4@huawei.com/
RFC-v4: https://lore.kernel.org/all/20250104101224.873926-1-zengheng4@huawei.com/
RFC-v3: https://lore.kernel.org/all/20241207092136.2488426-1-zengheng4@huawei.com/
RFC-v2: https://lore.kernel.org/all/20241119135104.595630-1-zengheng4@huawei.com/
RFC-v1: https://lore.kernel.org/all/20241114135037.918470-1-zengheng4@huawei.com/
---

Zeng Heng (9):
  fs/resctrl: Fix MPAM Partid parsing errors by preserving CDP state
    during umount
  arm_mpam: Add intPARTID and reqPARTID support for narrow PARTID
    feature
  arm_mpam: Disable Narrow-PARTID when MBA lacks support
  arm_mpam: Refactor rmid to reqPARTID/PMG mapping
  arm_mpam: Propagate control group config to sub-monitoring groups
  fs/resctrl: Add rmid_entry state helpers
  arm_mpam: Implement dynamic reqPARTID allocation for monitoring groups
  fs/resctrl: Wire up rmid expansion and reclaim functions
  arm64/mpam: Add mpam_sync_config() for dynamic rmid expansion

 arch/x86/include/asm/resctrl.h  |   7 +
 drivers/resctrl/mpam_devices.c  |  83 ++++++---
 drivers/resctrl/mpam_internal.h |   7 +-
 drivers/resctrl/mpam_resctrl.c  | 289 ++++++++++++++++++++++++++++----
 fs/resctrl/monitor.c            |  50 +++++-
 fs/resctrl/rdtgroup.c           |  24 ++-
 include/linux/arm_mpam.h        |  17 ++
 include/linux/resctrl.h         |  21 +++
 8 files changed, 434 insertions(+), 64 deletions(-)

--
2.25.1


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

end of thread, other threads:[~2026-04-20  8:20 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-17 13:21 [PATCH v3 0/9] arm_mpam: Introduce Narrow-PARTID feature Zeng Heng
2026-03-17 13:21 ` [PATCH v3 1/9] fs/resctrl: Fix MPAM Partid parsing errors by preserving CDP state during umount Zeng Heng
2026-03-20 17:07   ` Ben Horgan
2026-03-21  4:11     ` Zeng Heng
2026-03-21  6:39       ` Zeng Heng
2026-03-17 13:21 ` [PATCH v3 2/9] arm_mpam: Add intPARTID and reqPARTID support for narrow PARTID feature Zeng Heng
2026-03-17 13:21 ` [PATCH v3 3/9] arm_mpam: Disable Narrow-PARTID when MBA lacks support Zeng Heng
2026-04-10  1:07   ` Shaopeng Tan (Fujitsu)
2026-04-11  6:50     ` Zeng Heng
2026-04-13  9:12       ` Zeng Heng
2026-03-17 13:21 ` [PATCH v3 4/9] arm_mpam: Refactor rmid to reqPARTID/PMG mapping Zeng Heng
2026-03-17 13:21 ` [PATCH v3 5/9] arm_mpam: Propagate control group config to sub-monitoring groups Zeng Heng
2026-03-17 13:21 ` [PATCH v3 6/9] fs/resctrl: Add rmid_entry state helpers Zeng Heng
2026-03-17 13:21 ` [PATCH v3 7/9] arm_mpam: Implement dynamic reqPARTID allocation for monitoring groups Zeng Heng
2026-03-17 13:21 ` [PATCH v3 8/9] fs/resctrl: Wire up rmid expansion and reclaim functions Zeng Heng
2026-03-17 13:21 ` [PATCH v3 9/9] arm64/mpam: Add mpam_sync_config() for dynamic rmid expansion Zeng Heng
2026-03-20 16:14 ` [PATCH v3 0/9] arm_mpam: Introduce Narrow-PARTID feature Ben Horgan
2026-03-21  7:18   ` Zeng Heng
2026-04-10  0:13 ` Shaopeng Tan (Fujitsu)
2026-04-11  6:32   ` Zeng Heng
2026-04-16  6:11     ` Shaopeng Tan (Fujitsu)
2026-04-20  8:19       ` Zeng Heng

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®