aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kernel/cpu/resctrl/rdtgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/cpu/resctrl/rdtgroup.c')
-rw-r--r--arch/x86/kernel/cpu/resctrl/rdtgroup.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
index 7502b7de3916..2f29b7d7d602 100644
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
@@ -103,15 +103,12 @@ int closids_supported(void)
static void closid_init(void)
{
- struct rdt_hw_resource *hw_res;
struct resctrl_schema *s;
int rdt_min_closid = 32;
/* Compute rdt_min_closid across all resources */
- list_for_each_entry(s, &resctrl_schema_all, list) {
- hw_res = resctrl_to_arch_res(s->res);
- rdt_min_closid = min(rdt_min_closid, hw_res->num_closid);
- }
+ list_for_each_entry(s, &resctrl_schema_all, list)
+ rdt_min_closid = min(rdt_min_closid, s->num_closid);
closid_free_map = BIT_MASK(rdt_min_closid) - 1;
@@ -849,11 +846,8 @@ static int rdt_num_closids_show(struct kernfs_open_file *of,
struct seq_file *seq, void *v)
{
struct resctrl_schema *s = of->kn->parent->priv;
- struct rdt_resource *r = s->res;
- struct rdt_hw_resource *hw_res;
- hw_res = resctrl_to_arch_res(r);
- seq_printf(seq, "%d\n", hw_res->num_closid);
+ seq_printf(seq, "%u\n", s->num_closid);
return 0;
}
@@ -2140,6 +2134,7 @@ static int schemata_list_create(void)
s->res = r;
s->conf_type = resctrl_to_arch_res(r)->conf_type;
+ s->num_closid = resctrl_to_arch_res(r)->num_closid;
INIT_LIST_HEAD(&s->list);
list_add(&s->list, &resctrl_schema_all);