Skip to content

Commit 4bc3ef4

Browse files
aeglbp3tk0v
authored andcommitted
x86,fs/resctrl: Rename struct rdt_mon_domain and rdt_hw_mon_domain
The upcoming telemetry event monitoring is not tied to the L3 resource and will have a new domain structure. Rename the L3 resource specific domain data structures to include "l3_" in their names to avoid confusion between the different resource specific domain structures: rdt_mon_domain -> rdt_l3_mon_domain rdt_hw_mon_domain -> rdt_hw_l3_mon_domain No functional change. Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Link: https://lore.kernel.org/20251217172121.12030-1-tony.luck@intel.com
1 parent 6b10cf7 commit 4bc3ef4

8 files changed

Lines changed: 104 additions & 104 deletions

File tree

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ static void ctrl_domain_free(struct rdt_hw_ctrl_domain *hw_dom)
368368
kfree(hw_dom);
369369
}
370370

371-
static void mon_domain_free(struct rdt_hw_mon_domain *hw_dom)
371+
static void mon_domain_free(struct rdt_hw_l3_mon_domain *hw_dom)
372372
{
373373
int idx;
374374

@@ -405,7 +405,7 @@ static int domain_setup_ctrlval(struct rdt_resource *r, struct rdt_ctrl_domain *
405405
* @num_rmid: The size of the MBM counter array
406406
* @hw_dom: The domain that owns the allocated arrays
407407
*/
408-
static int arch_domain_mbm_alloc(u32 num_rmid, struct rdt_hw_mon_domain *hw_dom)
408+
static int arch_domain_mbm_alloc(u32 num_rmid, struct rdt_hw_l3_mon_domain *hw_dom)
409409
{
410410
size_t tsize = sizeof(*hw_dom->arch_mbm_states[0]);
411411
enum resctrl_event_id eventid;
@@ -503,8 +503,8 @@ static void domain_add_cpu_ctrl(int cpu, struct rdt_resource *r)
503503

504504
static void l3_mon_domain_setup(int cpu, int id, struct rdt_resource *r, struct list_head *add_pos)
505505
{
506-
struct rdt_hw_mon_domain *hw_dom;
507-
struct rdt_mon_domain *d;
506+
struct rdt_hw_l3_mon_domain *hw_dom;
507+
struct rdt_l3_mon_domain *d;
508508
struct cacheinfo *ci;
509509
int err;
510510

@@ -653,13 +653,13 @@ static void domain_remove_cpu_mon(int cpu, struct rdt_resource *r)
653653

654654
switch (r->rid) {
655655
case RDT_RESOURCE_L3: {
656-
struct rdt_hw_mon_domain *hw_dom;
657-
struct rdt_mon_domain *d;
656+
struct rdt_hw_l3_mon_domain *hw_dom;
657+
struct rdt_l3_mon_domain *d;
658658

659659
if (!domain_header_is_valid(hdr, RESCTRL_MON_DOMAIN, RDT_RESOURCE_L3))
660660
return;
661661

662-
d = container_of(hdr, struct rdt_mon_domain, hdr);
662+
d = container_of(hdr, struct rdt_l3_mon_domain, hdr);
663663
hw_dom = resctrl_to_arch_mon_dom(d);
664664
resctrl_offline_mon_domain(r, hdr);
665665
list_del_rcu(&hdr->list);

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,17 @@ struct rdt_hw_ctrl_domain {
6363
};
6464

6565
/**
66-
* struct rdt_hw_mon_domain - Arch private attributes of a set of CPUs that share
67-
* a resource for a monitor function
68-
* @d_resctrl: Properties exposed to the resctrl file system
66+
* struct rdt_hw_l3_mon_domain - Arch private attributes of a set of CPUs sharing
67+
* RDT_RESOURCE_L3 monitoring
68+
* @d_resctrl: Properties exposed to the resctrl file system
6969
* @arch_mbm_states: Per-event pointer to the MBM event's saved state.
7070
* An MBM event's state is an array of struct arch_mbm_state
7171
* indexed by RMID on x86.
7272
*
7373
* Members of this structure are accessed via helpers that provide abstraction.
7474
*/
75-
struct rdt_hw_mon_domain {
76-
struct rdt_mon_domain d_resctrl;
75+
struct rdt_hw_l3_mon_domain {
76+
struct rdt_l3_mon_domain d_resctrl;
7777
struct arch_mbm_state *arch_mbm_states[QOS_NUM_L3_MBM_EVENTS];
7878
};
7979

@@ -82,9 +82,9 @@ static inline struct rdt_hw_ctrl_domain *resctrl_to_arch_ctrl_dom(struct rdt_ctr
8282
return container_of(r, struct rdt_hw_ctrl_domain, d_resctrl);
8383
}
8484

85-
static inline struct rdt_hw_mon_domain *resctrl_to_arch_mon_dom(struct rdt_mon_domain *r)
85+
static inline struct rdt_hw_l3_mon_domain *resctrl_to_arch_mon_dom(struct rdt_l3_mon_domain *r)
8686
{
87-
return container_of(r, struct rdt_hw_mon_domain, d_resctrl);
87+
return container_of(r, struct rdt_hw_l3_mon_domain, d_resctrl);
8888
}
8989

9090
/**
@@ -140,7 +140,7 @@ static inline struct rdt_hw_resource *resctrl_to_arch_res(struct rdt_resource *r
140140

141141
extern struct rdt_hw_resource rdt_resources_all[];
142142

143-
void arch_mon_domain_online(struct rdt_resource *r, struct rdt_mon_domain *d);
143+
void arch_mon_domain_online(struct rdt_resource *r, struct rdt_l3_mon_domain *d);
144144

145145
/* CPUID.(EAX=10H, ECX=ResID=1).EAX */
146146
union cpuid_0x10_1_eax {

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static inline u64 get_corrected_mbm_count(u32 rmid, unsigned long val)
109109
*
110110
* In RMID sharing mode there are fewer "logical RMID" values available
111111
* to accumulate data ("physical RMIDs" are divided evenly between SNC
112-
* nodes that share an L3 cache). Linux creates an rdt_mon_domain for
112+
* nodes that share an L3 cache). Linux creates an rdt_l3_mon_domain for
113113
* each SNC node.
114114
*
115115
* The value loaded into IA32_PQR_ASSOC is the "logical RMID".
@@ -157,7 +157,7 @@ static int __rmid_read_phys(u32 prmid, enum resctrl_event_id eventid, u64 *val)
157157
return 0;
158158
}
159159

160-
static struct arch_mbm_state *get_arch_mbm_state(struct rdt_hw_mon_domain *hw_dom,
160+
static struct arch_mbm_state *get_arch_mbm_state(struct rdt_hw_l3_mon_domain *hw_dom,
161161
u32 rmid,
162162
enum resctrl_event_id eventid)
163163
{
@@ -171,11 +171,11 @@ static struct arch_mbm_state *get_arch_mbm_state(struct rdt_hw_mon_domain *hw_do
171171
return state ? &state[rmid] : NULL;
172172
}
173173

174-
void resctrl_arch_reset_rmid(struct rdt_resource *r, struct rdt_mon_domain *d,
174+
void resctrl_arch_reset_rmid(struct rdt_resource *r, struct rdt_l3_mon_domain *d,
175175
u32 unused, u32 rmid,
176176
enum resctrl_event_id eventid)
177177
{
178-
struct rdt_hw_mon_domain *hw_dom = resctrl_to_arch_mon_dom(d);
178+
struct rdt_hw_l3_mon_domain *hw_dom = resctrl_to_arch_mon_dom(d);
179179
int cpu = cpumask_any(&d->hdr.cpu_mask);
180180
struct arch_mbm_state *am;
181181
u32 prmid;
@@ -194,9 +194,9 @@ void resctrl_arch_reset_rmid(struct rdt_resource *r, struct rdt_mon_domain *d,
194194
* Assumes that hardware counters are also reset and thus that there is
195195
* no need to record initial non-zero counts.
196196
*/
197-
void resctrl_arch_reset_rmid_all(struct rdt_resource *r, struct rdt_mon_domain *d)
197+
void resctrl_arch_reset_rmid_all(struct rdt_resource *r, struct rdt_l3_mon_domain *d)
198198
{
199-
struct rdt_hw_mon_domain *hw_dom = resctrl_to_arch_mon_dom(d);
199+
struct rdt_hw_l3_mon_domain *hw_dom = resctrl_to_arch_mon_dom(d);
200200
enum resctrl_event_id eventid;
201201
int idx;
202202

@@ -217,10 +217,10 @@ static u64 mbm_overflow_count(u64 prev_msr, u64 cur_msr, unsigned int width)
217217
return chunks >> shift;
218218
}
219219

220-
static u64 get_corrected_val(struct rdt_resource *r, struct rdt_mon_domain *d,
220+
static u64 get_corrected_val(struct rdt_resource *r, struct rdt_l3_mon_domain *d,
221221
u32 rmid, enum resctrl_event_id eventid, u64 msr_val)
222222
{
223-
struct rdt_hw_mon_domain *hw_dom = resctrl_to_arch_mon_dom(d);
223+
struct rdt_hw_l3_mon_domain *hw_dom = resctrl_to_arch_mon_dom(d);
224224
struct rdt_hw_resource *hw_res = resctrl_to_arch_res(r);
225225
struct arch_mbm_state *am;
226226
u64 chunks;
@@ -242,9 +242,9 @@ int resctrl_arch_rmid_read(struct rdt_resource *r, struct rdt_domain_hdr *hdr,
242242
u32 unused, u32 rmid, enum resctrl_event_id eventid,
243243
u64 *val, void *ignored)
244244
{
245-
struct rdt_hw_mon_domain *hw_dom;
245+
struct rdt_hw_l3_mon_domain *hw_dom;
246+
struct rdt_l3_mon_domain *d;
246247
struct arch_mbm_state *am;
247-
struct rdt_mon_domain *d;
248248
u64 msr_val;
249249
u32 prmid;
250250
int cpu;
@@ -254,7 +254,7 @@ int resctrl_arch_rmid_read(struct rdt_resource *r, struct rdt_domain_hdr *hdr,
254254
if (!domain_header_is_valid(hdr, RESCTRL_MON_DOMAIN, RDT_RESOURCE_L3))
255255
return -EINVAL;
256256

257-
d = container_of(hdr, struct rdt_mon_domain, hdr);
257+
d = container_of(hdr, struct rdt_l3_mon_domain, hdr);
258258
hw_dom = resctrl_to_arch_mon_dom(d);
259259
cpu = cpumask_any(&hdr->cpu_mask);
260260
prmid = logical_rmid_to_physical_rmid(cpu, rmid);
@@ -308,11 +308,11 @@ static int __cntr_id_read(u32 cntr_id, u64 *val)
308308
return 0;
309309
}
310310

311-
void resctrl_arch_reset_cntr(struct rdt_resource *r, struct rdt_mon_domain *d,
311+
void resctrl_arch_reset_cntr(struct rdt_resource *r, struct rdt_l3_mon_domain *d,
312312
u32 unused, u32 rmid, int cntr_id,
313313
enum resctrl_event_id eventid)
314314
{
315-
struct rdt_hw_mon_domain *hw_dom = resctrl_to_arch_mon_dom(d);
315+
struct rdt_hw_l3_mon_domain *hw_dom = resctrl_to_arch_mon_dom(d);
316316
struct arch_mbm_state *am;
317317

318318
am = get_arch_mbm_state(hw_dom, rmid, eventid);
@@ -324,7 +324,7 @@ void resctrl_arch_reset_cntr(struct rdt_resource *r, struct rdt_mon_domain *d,
324324
}
325325
}
326326

327-
int resctrl_arch_cntr_read(struct rdt_resource *r, struct rdt_mon_domain *d,
327+
int resctrl_arch_cntr_read(struct rdt_resource *r, struct rdt_l3_mon_domain *d,
328328
u32 unused, u32 rmid, int cntr_id,
329329
enum resctrl_event_id eventid, u64 *val)
330330
{
@@ -354,7 +354,7 @@ int resctrl_arch_cntr_read(struct rdt_resource *r, struct rdt_mon_domain *d,
354354
* must adjust RMID counter numbers based on SNC node. See
355355
* logical_rmid_to_physical_rmid() for code that does this.
356356
*/
357-
void arch_mon_domain_online(struct rdt_resource *r, struct rdt_mon_domain *d)
357+
void arch_mon_domain_online(struct rdt_resource *r, struct rdt_l3_mon_domain *d)
358358
{
359359
if (snc_nodes_per_l3_cache > 1)
360360
msr_clear_bit(MSR_RMID_SNC_CONFIG, 0);
@@ -516,7 +516,7 @@ static void resctrl_abmc_set_one_amd(void *arg)
516516
*/
517517
static void _resctrl_abmc_enable(struct rdt_resource *r, bool enable)
518518
{
519-
struct rdt_mon_domain *d;
519+
struct rdt_l3_mon_domain *d;
520520

521521
lockdep_assert_cpus_held();
522522

@@ -555,11 +555,11 @@ static void resctrl_abmc_config_one_amd(void *info)
555555
/*
556556
* Send an IPI to the domain to assign the counter to RMID, event pair.
557557
*/
558-
void resctrl_arch_config_cntr(struct rdt_resource *r, struct rdt_mon_domain *d,
558+
void resctrl_arch_config_cntr(struct rdt_resource *r, struct rdt_l3_mon_domain *d,
559559
enum resctrl_event_id evtid, u32 rmid, u32 closid,
560560
u32 cntr_id, bool assign)
561561
{
562-
struct rdt_hw_mon_domain *hw_dom = resctrl_to_arch_mon_dom(d);
562+
struct rdt_hw_l3_mon_domain *hw_dom = resctrl_to_arch_mon_dom(d);
563563
union l3_qos_abmc_cfg abmc_cfg = { 0 };
564564
struct arch_mbm_state *am;
565565

fs/resctrl/ctrlmondata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,9 @@ int rdtgroup_mondata_show(struct seq_file *m, void *arg)
600600
struct kernfs_open_file *of = m->private;
601601
enum resctrl_res_level resid;
602602
enum resctrl_event_id evtid;
603+
struct rdt_l3_mon_domain *d;
603604
struct rdt_domain_hdr *hdr;
604605
struct rmid_read rr = {0};
605-
struct rdt_mon_domain *d;
606606
struct rdtgroup *rdtgrp;
607607
int domid, cpu, ret = 0;
608608
struct rdt_resource *r;

fs/resctrl/internal.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,22 +369,22 @@ void mon_event_read(struct rmid_read *rr, struct rdt_resource *r,
369369

370370
int resctrl_mon_resource_init(void);
371371

372-
void mbm_setup_overflow_handler(struct rdt_mon_domain *dom,
372+
void mbm_setup_overflow_handler(struct rdt_l3_mon_domain *dom,
373373
unsigned long delay_ms,
374374
int exclude_cpu);
375375

376376
void mbm_handle_overflow(struct work_struct *work);
377377

378378
bool is_mba_sc(struct rdt_resource *r);
379379

380-
void cqm_setup_limbo_handler(struct rdt_mon_domain *dom, unsigned long delay_ms,
380+
void cqm_setup_limbo_handler(struct rdt_l3_mon_domain *dom, unsigned long delay_ms,
381381
int exclude_cpu);
382382

383383
void cqm_handle_limbo(struct work_struct *work);
384384

385-
bool has_busy_rmid(struct rdt_mon_domain *d);
385+
bool has_busy_rmid(struct rdt_l3_mon_domain *d);
386386

387-
void __check_limbo(struct rdt_mon_domain *d, bool force_free);
387+
void __check_limbo(struct rdt_l3_mon_domain *d, bool force_free);
388388

389389
void resctrl_file_fflags_init(const char *config, unsigned long fflags);
390390

0 commit comments

Comments
 (0)