From: Jinjie Ruan <ruanjinjie@huawei.com>
To: <james.morse@arm.com>, <ben.horgan@arm.com>,
<reinette.chatre@intel.com>, <fenghuay@nvidia.com>,
<catalin.marinas@arm.com>, <will@kernel.org>,
<mark.rutland@arm.com>, <corbet@lwn.net>,
<skhan@linuxfoundation.org>, <rdunlap@infradead.org>,
<tony.luck@intel.com>, <Dave.Martin@arm.com>,
<babu.moger@amd.com>, <fustini@kernel.org>, <tglx@kernel.org>,
<mingo@redhat.com>, <bp@alien8.de>, <dave.hansen@linux.intel.com>,
<hpa@zytor.com>, <x86@kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH v3 00/19] arm_mpam: Add L2 cache monitors
Date: Fri, 27 Nov 2026 10:42:34 +0800 [thread overview]
Message-ID: <f1fa83e4-465e-4bf0-b751-63307628c432@huawei.com> (raw)
In-Reply-To: <20261116125914.498841-1-ruanjinjie@huawei.com>
在 2026/11/16 20:58, Jinjie Ruan 写道:
> Resctrl exposes cache occupancy and bandwidth monitoring only at the L3
> scope. MPAM can count the same things on an L2 cache: firmware points
> an MSC at the cache it belongs to, and its CSU and MBWU counters can
> report the occupancy of that L2 slice and the traffic the cache sees.
>
> This series first reworks resctrl's monitor bookkeeping to track events
> by scope instead of by resource, and then exposes those counters as
> "l2c_occupancy" and "mbm_core_bytes"
>
> The patch set is organized as follows:
>
> - Patches 1-4: Rename to drop the L3 prefix
> - Patches 5-7: Rework the bookkeeping, index monitor state by resource
> and event, index the event table by scope and eventid
> - Patches 8-13: Make the core per-resource and add the L2 events
> - Patches 14-18: Let the driver pick L2 classes for the L2 resource,
> and expose the L2 events
> - Patch 19: Update the documentation
Hi Reinette and Ben,
Does this refactoring now meet your expectations? or any new suggestions
for improvement?
In my opinion, the compatibility issue of the CPU-less node seems to
have been resolved, and L2 also reuses the monitoring path related to L3.
Best regards,
Jinjie
>
> Notes on the user interface
> ===========================
>
> The L3 event names and semantics, the L3_MON and mon_L3_xx names and
> the x86 PERF_PKG files are unchanged.
>
> The L2 bandwidth event is called mbm_core_bytes because it counts the
> bytes the L2 cache sees, which is not memory bandwidth.
>
> And mbm_L3_assignments remains L3-only.
>
> Testing
> =======
>
> QEMU, topology with L2, L3 and memory-controller MSCs:
>
> - info/L2_MON lists l2c_occupancy and mbm_core_bytes, and per-core
> mon_L2_xx directories are created.
>
> - Reads: l2c_occupancy 262144 bytes (50% of a 512KiB L2),
> llc_occupancy unchanged, mbm_core_bytes advances about 20GB per 2s
> sample.
>
> - CDP halves num_closids and the monitor counts of every monitor
> resource.
>
> - RMID limbo: a freed RMID is marked busy in every L2 and L3 monitor
> domain, and becomes allocatable again once those domains are
> offlined and the busy count reaches zero.
>
> QEMU branch: https://github.com/ruanjinjie-eng/qemu/tree/mpam
> Test cases: https://github.com/ruanjinjie-eng/mpam_testcase
>
> This series is rebased on v7.4 rc3 and also available at:
> https://github.com/ruanjinjie-eng/linux/commits/mpam-l2mon-scope
>
> Changes in RFC v3
> - The event table is indexed by scope instead of by resource (Reinette)
> - Patch 6 is split out so no helper takes an unused argument.
> - The RMID limbo threshold is kept per resource, so an L3 domain no
> longer compares its occupancy with an L2-sized value
> - Bugfixes are split out as their own series.
> - RFC v2: https://lore.kernel.org/all/20261029123611.1108424-1-ruanjinjie@huawei.com/
>
> Changes in RFC v2:
> - As Ben suggested, the existing event types now apply to any resource,
> instead of adding L2-only event IDs.
> - As Ben suggested, L2 bandwidth uses an assignable counter that stays
> with the monitoring group, not a monitor borrowed for each read.
> - The CDP change also halves the assignable counter count, for every
> monitor resource.
> - Split by subsystem so resctrl, x86 and MPAM can be reviewed separately.
> - Fix a CDP bug: a failed enable left the driver believing CDP was on.
> - RFC v1: https://lore.kernel.org/all/20261022084821.4014873-1-ruanjinjie@huawei.com/
>
> Jinjie Ruan (19):
> fs/resctrl: Rename monitor events to drop the L3 prefix
> x86/resctrl: Use the resource-agnostic monitor event names
> arm_mpam: resctrl: Use the resource-agnostic monitor event names
> resctrl: Remove the L3 monitor event names
> arm_mpam: resctrl: Index monitor state by resource and event
> x86,fs/resctrl: Record the resource that enables a monitor event
> x86,fs/resctrl: Track monitor events by scope
> fs/resctrl: Generalize __l3_mon_event_count for non-L3 resources
> fs/resctrl: Add the L2 monitor events
> fs/resctrl: Set up MBM state and workers for every monitor resource
> resctrl: Keep the RMID limbo threshold per resource
> fs/resctrl: Check RMID limbo on every resource with occupancy
> fs/resctrl: Manage assignable counters for every monitor resource
> arm_mpam: resctrl: Halve the monitor counts of every resource on CDP
> arm_mpam: resctrl: Look up the monitor domain id from the components
> arm_mpam: resctrl: Report counter assignment per resource
> arm_mpam: resctrl: Allow monitoring on resources other than the L3
> arm_mpam: resctrl: Expose the L2 monitor events
> Documentation: arm64: mpam: Describe the L2 monitor events
>
> Documentation/arch/arm64/mpam.rst | 25 +-
> Documentation/filesystems/resctrl.rst | 11 +
> arch/x86/kernel/cpu/resctrl/core.c | 13 +-
> arch/x86/kernel/cpu/resctrl/intel_aet.c | 2 +-
> arch/x86/kernel/cpu/resctrl/internal.h | 2 +-
> arch/x86/kernel/cpu/resctrl/monitor.c | 10 +-
> arch/x86/kernel/cpu/resctrl/rdtgroup.c | 8 +-
> drivers/resctrl/mpam_resctrl.c | 357 ++++++++++++++----------
> fs/resctrl/ctrlmondata.c | 13 +-
> fs/resctrl/internal.h | 55 +++-
> fs/resctrl/monitor.c | 328 +++++++++++++---------
> fs/resctrl/rdtgroup.c | 158 ++++++-----
> include/linux/resctrl.h | 36 ++-
> include/linux/resctrl_types.h | 16 +-
> 14 files changed, 619 insertions(+), 415 deletions(-)
>
prev parent reply other threads:[~2026-11-27 2:42 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 12:58 Jinjie Ruan
2026-11-16 12:58 ` [RFC PATCH v3 01/19] fs/resctrl: Rename monitor events to drop the L3 prefix Jinjie Ruan
2026-11-16 12:58 ` [RFC PATCH v3 02/19] x86/resctrl: Use the resource-agnostic monitor event names Jinjie Ruan
2026-11-16 12:58 ` [RFC PATCH v3 03/19] arm_mpam: resctrl: " Jinjie Ruan
2026-11-16 12:58 ` [RFC PATCH v3 04/19] resctrl: Remove the L3 " Jinjie Ruan
2026-11-16 12:59 ` [RFC PATCH v3 05/19] arm_mpam: resctrl: Index monitor state by resource and event Jinjie Ruan
2026-11-16 12:59 ` [RFC PATCH v3 06/19] x86,fs/resctrl: Record the resource that enables a monitor event Jinjie Ruan
2026-11-16 12:59 ` [RFC PATCH v3 07/19] x86,fs/resctrl: Track monitor events by scope Jinjie Ruan
2026-11-16 12:59 ` [RFC PATCH v3 08/19] fs/resctrl: Generalize __l3_mon_event_count for non-L3 resources Jinjie Ruan
2026-11-16 12:59 ` [RFC PATCH v3 09/19] fs/resctrl: Add the L2 monitor events Jinjie Ruan
2026-11-16 12:59 ` [RFC PATCH v3 10/19] fs/resctrl: Set up MBM state and workers for every monitor resource Jinjie Ruan
2026-11-16 12:59 ` [RFC PATCH v3 11/19] resctrl: Keep the RMID limbo threshold per resource Jinjie Ruan
2026-11-16 12:59 ` [RFC PATCH v3 12/19] fs/resctrl: Check RMID limbo on every resource with occupancy Jinjie Ruan
2026-11-16 12:59 ` [RFC PATCH v3 13/19] fs/resctrl: Manage assignable counters for every monitor resource Jinjie Ruan
2026-11-16 12:59 ` [RFC PATCH v3 14/19] arm_mpam: resctrl: Halve the monitor counts of every resource on CDP Jinjie Ruan
2026-11-16 12:59 ` [RFC PATCH v3 15/19] arm_mpam: resctrl: Look up the monitor domain id from the components Jinjie Ruan
2026-11-16 12:59 ` [RFC PATCH v3 16/19] arm_mpam: resctrl: Report counter assignment per resource Jinjie Ruan
2026-11-16 12:59 ` [RFC PATCH v3 17/19] arm_mpam: resctrl: Allow monitoring on resources other than the L3 Jinjie Ruan
2026-11-16 12:59 ` [RFC PATCH v3 18/19] arm_mpam: resctrl: Expose the L2 monitor events Jinjie Ruan
2026-11-16 12:59 ` [RFC PATCH v3 19/19] Documentation: arm64: mpam: Describe " Jinjie Ruan
2026-11-27 2:42 ` Jinjie Ruan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f1fa83e4-465e-4bf0-b751-63307628c432@huawei.com \
--to=ruanjinjie@huawei.com \
--cc=Dave.Martin@arm.com \
--cc=babu.moger@amd.com \
--cc=ben.horgan@arm.com \
--cc=bp@alien8.de \
--cc=catalin.marinas@arm.com \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=fenghuay@nvidia.com \
--cc=fustini@kernel.org \
--cc=hpa@zytor.com \
--cc=james.morse@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=rdunlap@infradead.org \
--cc=reinette.chatre@intel.com \
--cc=skhan@linuxfoundation.org \
--cc=tglx@kernel.org \
--cc=tony.luck@intel.com \
--cc=will@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®