From: Yunhui Cui <cuiyunhui@bytedance.com>
To: tony.luck@intel.com, reinette.chatre@intel.com,
ben.horgan@arm.com, Dave.Martin@arm.com, james.morse@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, fenghuay@nvidia.com, shuah@kernel.org,
corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org,
x86@kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org,
kunit-dev@googlegroups.com, linux-doc@vger.kernel.org
Cc: Yunhui Cui <cuiyunhui@bytedance.com>
Subject: [RFC PATCH 04/13] arm_mpam: Record PARTID narrowing capacity per MSC
Date: Mon, 30 Nov 2026 10:29:20 +0800 [thread overview]
Message-ID: <20261130022929.71748-5-cuiyunhui@bytedance.com> (raw)
In-Reply-To: <20261130022929.71748-1-cuiyunhui@bytedance.com>
PARTID_NRW_IDR reports the number of internal PARTIDs provided by an MSC
and is not selected by RIS, so every RIS in an MSC sees the same
capacity. Record the internal PARTID count when the first usable
narrowing RIS is probed and use it for the existing request PARTID limit
instead of reading the same register for each RIS. No functional change
is intended.
Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com>
---
drivers/resctrl/mpam_devices.c | 25 +++++++++++--------------
drivers/resctrl/mpam_internal.h | 1 +
2 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c
index 27abf60f4d675..e2791d5368765 100644
--- a/drivers/resctrl/mpam_devices.c
+++ b/drivers/resctrl/mpam_devices.c
@@ -1131,25 +1131,22 @@ static int mpam_ris_hw_probe(struct mpam_msc_ris *ris)
}
}
- /*
- * RIS with PARTID narrowing don't have enough storage for one
- * configuration per PARTID. If these are in a class we could use,
- * reduce the supported partid_max to match the number of intpartid.
- * If the class is unknown, just ignore it.
- */
+ /* Cache the MSC-wide limit without probing unused resource classes. */
if (FIELD_GET(MPAMF_IDR_HAS_PARTID_NRW, ris->idr) &&
class->type != MPAM_CLASS_UNKNOWN) {
- u16 partid_max;
u32 nrwidr;
- err = mpam_read_partsel_reg(msc, PARTID_NRW_IDR, &nrwidr);
- if (err)
- return err;
-
- partid_max = FIELD_GET(MPAMF_PARTID_NRW_IDR_INTPARTID_MAX, nrwidr);
-
+ if (!msc->nr_intpartids) {
+ err = mpam_read_partsel_reg(msc, PARTID_NRW_IDR, &nrwidr);
+ if (err)
+ return err;
+ msc->nr_intpartids =
+ FIELD_GET(MPAMF_PARTID_NRW_IDR_INTPARTID_MAX,
+ nrwidr) + 1;
+ }
mpam_set_feature(mpam_feat_partid_nrw, props);
- msc->partid_max = min(msc->partid_max, partid_max);
+ msc->partid_max = min_t(u32, msc->partid_max,
+ msc->nr_intpartids - 1);
}
return 0;
diff --git a/drivers/resctrl/mpam_internal.h b/drivers/resctrl/mpam_internal.h
index 1f86cc158100b..90430bd208ee8 100644
--- a/drivers/resctrl/mpam_internal.h
+++ b/drivers/resctrl/mpam_internal.h
@@ -94,6 +94,7 @@ struct mpam_msc {
struct mutex probe_lock;
bool probed;
u16 partid_max;
+ u32 nr_intpartids;
u8 pmg_max;
unsigned long ris_idxs;
u32 ris_max;
--
2.39.2 (Apple Git-143)
next prev parent reply other threads:[~2026-11-30 2:30 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 2:29 [RFC PATCH 00/13] resctrl: Introduce a framework for logical control IDs Yunhui Cui
2026-11-30 2:29 ` [RFC PATCH 01/13] resctrl: Introduce interfaces " Yunhui Cui
2026-11-30 2:29 ` [RFC PATCH 02/13] resctrl: Add prepare, commit and abort hooks for control updates Yunhui Cui
2026-11-30 2:29 ` [RFC PATCH 03/13] resctrl: Add a release hook before logical control ID reuse Yunhui Cui
2026-11-30 2:29 ` Yunhui Cui [this message]
2026-11-30 2:29 ` [RFC PATCH 05/13] arm_mpam: Select PARTID narrowing per component Yunhui Cui
2026-11-30 2:29 ` [RFC PATCH 06/13] arm_mpam: Add an internal PARTID allocator Yunhui Cui
2026-11-30 2:29 ` [RFC PATCH 07/13] arm_mpam: Add request-to-internal PARTID mapping Yunhui Cui
2026-11-30 2:29 ` [RFC PATCH 08/13] arm_mpam: Apply PARTID narrowing to resctrl control groups Yunhui Cui
2026-11-30 2:29 ` [RFC PATCH 09/13] arm_mpam: Separate request and internal PARTID limits Yunhui Cui
2026-11-30 2:29 ` [RFC PATCH 10/13] arm_mpam: Map CDP data and code defaults separately Yunhui Cui
2026-11-30 2:29 ` [RFC PATCH 11/13] arm_mpam: Add kunit tests for PARTID narrowing Yunhui Cui
2026-11-30 2:29 ` [RFC PATCH 12/13] selftests/resctrl: Add a test for control ID allocation and reuse Yunhui Cui
2026-11-30 2:29 ` [RFC PATCH 13/13] docs/resctrl: Document logical control IDs and hardware entries Yunhui Cui
2026-11-30 6:15 ` [RFC PATCH 00/13] resctrl: Introduce a framework for logical control IDs Jinjie Ruan
2026-11-30 6:56 ` [External] " yunhui cui
2026-11-30 7:29 ` Jinjie Ruan
2026-11-30 11:22 ` Ben Horgan
2026-11-30 12:09 ` Jinjie Ruan
2026-11-30 14:09 ` [External] " yunhui cui
2026-11-30 15:22 ` Ben Horgan
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=20261130022929.71748-5-cuiyunhui@bytedance.com \
--to=cuiyunhui@bytedance.com \
--cc=Dave.Martin@arm.com \
--cc=babu.moger@amd.com \
--cc=ben.horgan@arm.com \
--cc=bp@alien8.de \
--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=kunit-dev@googlegroups.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mingo@redhat.com \
--cc=rdunlap@infradead.org \
--cc=reinette.chatre@intel.com \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=tglx@kernel.org \
--cc=tony.luck@intel.com \
--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®