[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250117151033.1517882-6-Dave.Martin@arm.com>
Date: Fri, 17 Jan 2025 15:10:15 +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 05/11] arm_mpam: resctrl: Implement arch hook to set up the default CLOSID
Since the allocation of CLOSIDs can now depend on parameters such
as resctrl filesystem mount options that are not available at arch
driver init time, all MPAM resource allocations need to be
reprogrammed when resctrl is mounted.
Implement resctrl_arch_init_domains() so that resctrl will now
reprogram the default CLOSID's resource allocations at filesystem
mount time, in the same way as when creating a new resctrl control
group.
Signed-off-by: Dave Martin <Dave.Martin@....com>
---
drivers/platform/arm64/mpam/mpam_resctrl.c | 15 +++++++++++++--
include/linux/arm_mpam.h | 7 +------
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/drivers/platform/arm64/mpam/mpam_resctrl.c b/drivers/platform/arm64/mpam/mpam_resctrl.c
index 30f2caec11d7..aa8a6c077918 100644
--- a/drivers/platform/arm64/mpam/mpam_resctrl.c
+++ b/drivers/platform/arm64/mpam/mpam_resctrl.c
@@ -1209,7 +1209,8 @@ int resctrl_arch_update_one(struct rdt_resource *r, struct rdt_ctrl_domain *d,
}
/* TODO: this is IPI heavy */
-int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid)
+static int __resctrl_arch_update_domains(struct rdt_resource *r, u32 closid,
+ bool force)
{
int err = 0;
enum resctrl_conf_type t;
@@ -1222,7 +1223,7 @@ 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++) {
cfg = &d->staged_config[t];
- if (!cfg->have_new_ctrl)
+ if (!force && !cfg->have_new_ctrl)
continue;
err = resctrl_arch_update_one(r, d, closid, t,
@@ -1235,6 +1236,16 @@ int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid)
return err;
}
+int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid)
+{
+ return __resctrl_arch_update_domains(r, closid, false);
+}
+
+int resctrl_arch_init_domains(struct rdt_resource *r, u32 closid)
+{
+ return __resctrl_arch_update_domains(r, closid, true);
+}
+
void resctrl_arch_reset_resources(void)
{
int i, idx;
diff --git a/include/linux/arm_mpam.h b/include/linux/arm_mpam.h
index dd5f18474846..e6b188ab735b 100644
--- a/include/linux/arm_mpam.h
+++ b/include/linux/arm_mpam.h
@@ -47,12 +47,7 @@ static inline unsigned int resctrl_arch_round_mon_val(unsigned int val)
static inline bool resctrl_arch_default_closid_needs_init(void)
{
- return false;
-}
-
-static inline int resctrl_arch_init_domains(struct rdt_resource *r, u32 closid)
-{
- return 0;
+ return true;
}
bool resctrl_arch_alloc_capable(void);
--
2.34.1
Powered by blists - more mailing lists