Skip to content

Commit 32150ed

Browse files
James Morsesuryasaimadhu
authored andcommitted
x86/resctrl: Swizzle rdt_resource and resctrl_schema in pseudo_lock_region
struct pseudo_lock_region points to the rdt_resource. Once the resources are merged, this won't be unique. The resource name is moving into the schema, so that the filesystem portions of resctrl can generate it. Swap pseudo_lock_region's rdt_resource pointer for a schema pointer. Signed-off-by: James Morse <james.morse@arm.com> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Jamie Iles <jamie@nuviainc.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Tested-by: Babu Moger <babu.moger@amd.com> Link: https://lkml.kernel.org/r/20210728170637.25610-11-james.morse@arm.com
1 parent 1c29068 commit 32150ed

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

arch/x86/kernel/cpu/resctrl/ctrlmondata.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ static int parse_line(char *line, struct resctrl_schema *s,
227227
* the required initialization for single
228228
* region and return.
229229
*/
230-
rdtgrp->plr->r = r;
230+
rdtgrp->plr->s = s;
231231
rdtgrp->plr->d = d;
232232
rdtgrp->plr->cbm = d->new_ctrl;
233233
d->plr = rdtgrp->plr;
@@ -426,7 +426,7 @@ int rdtgroup_schemata_show(struct kernfs_open_file *of,
426426
ret = -ENODEV;
427427
} else {
428428
seq_printf(s, "%s:%d=%x\n",
429-
rdtgrp->plr->r->name,
429+
rdtgrp->plr->s->res->name,
430430
rdtgrp->plr->d->id,
431431
rdtgrp->plr->cbm);
432432
}

arch/x86/kernel/cpu/resctrl/internal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ struct mongroup {
163163

164164
/**
165165
* struct pseudo_lock_region - pseudo-lock region information
166-
* @r: RDT resource to which this pseudo-locked region
167-
* belongs
166+
* @s: Resctrl schema for the resource to which this
167+
* pseudo-locked region belongs
168168
* @d: RDT domain to which this pseudo-locked region
169169
* belongs
170170
* @cbm: bitmask of the pseudo-locked region
@@ -184,7 +184,7 @@ struct mongroup {
184184
* @pm_reqs: Power management QoS requests related to this region
185185
*/
186186
struct pseudo_lock_region {
187-
struct rdt_resource *r;
187+
struct resctrl_schema *s;
188188
struct rdt_domain *d;
189189
u32 cbm;
190190
wait_queue_head_t lock_thread_wq;

arch/x86/kernel/cpu/resctrl/pseudo_lock.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ static void pseudo_lock_region_clear(struct pseudo_lock_region *plr)
250250
plr->line_size = 0;
251251
kfree(plr->kmem);
252252
plr->kmem = NULL;
253-
plr->r = NULL;
253+
plr->s = NULL;
254254
if (plr->d)
255255
plr->d->plr = NULL;
256256
plr->d = NULL;
@@ -294,10 +294,10 @@ static int pseudo_lock_region_init(struct pseudo_lock_region *plr)
294294

295295
ci = get_cpu_cacheinfo(plr->cpu);
296296

297-
plr->size = rdtgroup_cbm_to_size(plr->r, plr->d, plr->cbm);
297+
plr->size = rdtgroup_cbm_to_size(plr->s->res, plr->d, plr->cbm);
298298

299299
for (i = 0; i < ci->num_leaves; i++) {
300-
if (ci->info_list[i].level == plr->r->cache_level) {
300+
if (ci->info_list[i].level == plr->s->res->cache_level) {
301301
plr->line_size = ci->info_list[i].coherency_line_size;
302302
return 0;
303303
}
@@ -800,7 +800,7 @@ bool rdtgroup_cbm_overlaps_pseudo_locked(struct rdt_domain *d, unsigned long cbm
800800
unsigned long cbm_b;
801801

802802
if (d->plr) {
803-
cbm_len = d->plr->r->cache.cbm_len;
803+
cbm_len = d->plr->s->res->cache.cbm_len;
804804
cbm_b = d->plr->cbm;
805805
if (bitmap_intersects(&cbm, &cbm_b, cbm_len))
806806
return true;

arch/x86/kernel/cpu/resctrl/rdtgroup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,8 +1439,8 @@ static int rdtgroup_size_show(struct kernfs_open_file *of,
14391439
ret = -ENODEV;
14401440
} else {
14411441
seq_printf(s, "%*s:", max_name_width,
1442-
rdtgrp->plr->r->name);
1443-
size = rdtgroup_cbm_to_size(rdtgrp->plr->r,
1442+
rdtgrp->plr->s->res->name);
1443+
size = rdtgroup_cbm_to_size(rdtgrp->plr->s->res,
14441444
rdtgrp->plr->d,
14451445
rdtgrp->plr->cbm);
14461446
seq_printf(s, "%d=%u\n", rdtgrp->plr->d->id, size);

0 commit comments

Comments
 (0)