[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250117151033.1517882-23-Dave.Martin@arm.com>
Date: Fri, 17 Jan 2025 15:10:32 +0000
From: Dave Martin <Dave.Martin@....com>
To: linux-kernel@...r.kernel.org
Cc: linux-arm-kernel@...ts.infradead.org,
Zeng Heng <zengheng4@...wei.com>,
Shaopeng Tan <tan.shaopeng@...itsu.com>,
James Morse <james.morse@....com>
Subject: [RFC PATCH v2 10/11] arm_mpam: Skip inapplicable cases when reprogramming a resctrl domain
The implementation of resctrl_arch_update_domains() currently
iterates over all types of staged configuration changes passed from
resctrl, irrespective of whether a given type (CDP_CODE, CDP_DATA
or CDP_NONE) makes sense for the affected MPAM resource. Since
resctrl will not stage any updates of inappropriate type for the
resource, this is mostly harmless.
When doing a forced update as a result of a call via
resctrl_arch_init_domains() however, there is a need to update the
cpartid (intPARTID) even if no staged configuration changes are
supplied. This can result in intPARTID being repeatedly
reprogrammed with different values. As well as being inefficient,
the final value may not be the correct one.
To program just once with the correct intPARTID, only apply the
update types that actually make sense for the resource.
Signed-off-by: Dave Martin <Dave.Martin@....com>
---
drivers/platform/arm64/mpam/mpam_resctrl.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/platform/arm64/mpam/mpam_resctrl.c b/drivers/platform/arm64/mpam/mpam_resctrl.c
index f1d0d9f59771..1f31b1455f66 100644
--- a/drivers/platform/arm64/mpam/mpam_resctrl.c
+++ b/drivers/platform/arm64/mpam/mpam_resctrl.c
@@ -1263,6 +1263,10 @@ static int __resctrl_arch_update_domains(struct rdt_resource *r, u32 closid,
list_for_each_entry(d, &r->ctrl_domains, hdr.list) {
for (t = 0; t < CDP_NUM_TYPES; t++) {
+ if ((t == CDP_NONE) !=
+ (!cdp_enabled || mpam_resctrl_hide_cdp(r->rid)))
+ continue;
+
cfg = &d->staged_config[t];
if (!force && !cfg->have_new_ctrl)
continue;
--
2.34.1
Powered by blists - more mailing lists