@@ -39,7 +39,8 @@ static bool apply_config(struct rdt_hw_domain *hw_dom,
}
int resctrl_arch_update_one(struct rdt_resource *r, struct rdt_domain *d,
- u32 closid, enum resctrl_conf_type t, u32 cfg_val)
+ u32 closid, enum resctrl_conf_type t, u32 cfg_val,
+ enum resctrl_ctrl_type type)
{
struct rdt_hw_resource *hw_res = resctrl_to_arch_res(r);
struct rdt_hw_domain *hw_dom = resctrl_to_arch_dom(d);
@@ -59,7 +60,8 @@ int resctrl_arch_update_one(struct rdt_resource *r, struct rdt_domain *d,
return 0;
}
-int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid)
+int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid,
+ enum resctrl_ctrl_type type)
{
struct resctrl_staged_config *cfg;
struct rdt_hw_domain *hw_dom;
@@ -920,7 +920,8 @@ u32 resctrl_arch_get_config(struct rdt_resource *r, struct rdt_domain *d,
}
int resctrl_arch_update_one(struct rdt_resource *r, struct rdt_domain *d,
- u32 closid, enum resctrl_conf_type t, u32 cfg_val)
+ u32 closid, enum resctrl_conf_type t, u32 cfg_val,
+ enum resctrl_ctrl_type type)
{
int err;
u32 partid;
@@ -983,7 +984,8 @@ int resctrl_arch_update_one(struct rdt_resource *r, struct rdt_domain *d,
}
/* TODO: this is IPI heavy */
-int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid)
+int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid,
+ enum resctrl_ctrl_type type)
{
int err = 0;
struct rdt_domain *d;
@@ -1000,7 +1002,8 @@ int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid)
continue;
err = resctrl_arch_update_one(r, d, closid, t,
- cfg->new_ctrl);
+ cfg->new_ctrl,
+ type);
if (err)
return err;
}
@@ -405,7 +405,8 @@ ssize_t rdtgroup_schemata_write(struct kernfs_open_file *of,
continue;
if (!strcmp(resname, s->name)) {
- ret = resctrl_arch_update_domains(r, rdtgrp->closid);
+ ret = resctrl_arch_update_domains(r, rdtgrp->closid,
+ s->ctrl_type);
if (ret)
goto out;
}
@@ -514,7 +514,8 @@ static void update_mba_bw(struct rdtgroup *rgrp, struct rdt_domain *dom_mbm)
return;
}
- resctrl_arch_update_one(r_mba, dom_mba, closid, CDP_NONE, new_msr_val);
+ resctrl_arch_update_one(r_mba, dom_mba, closid, CDP_NONE, new_msr_val,
+ SCHEMA_BASIC);
/*
* Delta values are updated dynamically package wise for each
@@ -3136,7 +3136,8 @@ static int rdtgroup_init_alloc(struct rdtgroup *rdtgrp)
return ret;
}
- ret = resctrl_arch_update_domains(r, rdtgrp->closid);
+ ret = resctrl_arch_update_domains(r, rdtgrp->closid,
+ s->ctrl_type);
if (ret < 0) {
rdt_last_cmd_puts("Failed to initialize allocations\n");
return ret;
@@ -334,7 +334,8 @@ int resctrl_rdtgroup_show(struct seq_file *seq, u32 closid, u32 rmid);
u32 resctrl_arch_get_num_closid(struct rdt_resource *r);
struct rdt_domain *resctrl_arch_find_domain(struct rdt_resource *r, int id);
-int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid);
+int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid,
+ enum resctrl_ctrl_type type);
/* For use by arch code that needs to remap resctrl's smaller CDP closid */
static inline u32 resctrl_get_config_index(u32 closid,
@@ -374,7 +375,8 @@ resctrl_get_domain_from_cpu(int cpu, struct rdt_resource *r)
* Must be called on one of the domain's CPUs.
*/
int resctrl_arch_update_one(struct rdt_resource *r, struct rdt_domain *d,
- u32 closid, enum resctrl_conf_type t, u32 cfg_val);
+ u32 closid, enum resctrl_conf_type t, u32 cfg_val,
+ enum resctrl_ctrl_type ctrl_type);
u32 resctrl_arch_get_config(struct rdt_resource *r, struct rdt_domain *d,
u32 closid, enum resctrl_conf_type type,
Now that, we have support for different control types, divided into the BASIC and PRIORITY controls types. Schemata list is pertained to the SCHEMAT_BASIC control type that is used to set up/configure CAT (Cache Allocation Technology) and MBA (Memory Bandwidth Allocation) capabilities, and SCHEMAT_DSPRI used to configure downstream priority partitioning. Let's add boilerplate changes to set the control configuration based on different control types. Signed-off-by: Amit Singh Tomar <amitsinght@marvell.com> --- Changes since RFC: * No change, it's new patch. --- arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 6 ++++-- drivers/platform/mpam/mpam_resctrl.c | 9 ++++++--- fs/resctrl/ctrlmondata.c | 3 ++- fs/resctrl/monitor.c | 3 ++- fs/resctrl/rdtgroup.c | 3 ++- include/linux/resctrl.h | 6 ++++-- 6 files changed, 20 insertions(+), 10 deletions(-)