Skip to content

Commit 8079565

Browse files
James Morsebp3tk0v
authored andcommitted
x86/resctrl: Expose resctrl fs's init function to the rest of the kernel
rdtgroup_init() needs exposing to the rest of the kernel so that arch code can call it once it lives in core code. As this is one of the few functions exposed, rename it to have "resctrl" in the name. The same goes for the exit call. Rename x86's arch code init functions for RDT to have an arch prefix to make it clear these are part of the architecture code. Co-developed-by: Dave Martin <Dave.Martin@arm.com> Signed-off-by: Dave Martin <Dave.Martin@arm.com> Signed-off-by: James Morse <james.morse@arm.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Reviewed-by: Tony Luck <tony.luck@intel.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Reviewed-by: Fenghua Yu <fenghuay@nvidia.com> Reviewed-by: Babu Moger <babu.moger@amd.com> Tested-by: Carl Worth <carl@os.amperecomputing.com> # arm64 Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Tested-by: Peter Newman <peternewman@google.com> Tested-by: Amit Singh Tomar <amitsinght@marvell.com> # arm64 Tested-by: Shanker Donthineni <sdonthineni@nvidia.com> # arm64 Tested-by: Babu Moger <babu.moger@amd.com> Link: https://lore.kernel.org/r/20250311183715.16445-12-james.morse@arm.com
1 parent 6f06aee commit 8079565

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ void resctrl_cpu_detect(struct cpuinfo_x86 *c)
10611061
}
10621062
}
10631063

1064-
static int __init resctrl_late_init(void)
1064+
static int __init resctrl_arch_late_init(void)
10651065
{
10661066
struct rdt_resource *r;
10671067
int state, ret;
@@ -1084,7 +1084,7 @@ static int __init resctrl_late_init(void)
10841084
if (state < 0)
10851085
return state;
10861086

1087-
ret = rdtgroup_init();
1087+
ret = resctrl_init();
10881088
if (ret) {
10891089
cpuhp_remove_state(state);
10901090
return ret;
@@ -1100,18 +1100,18 @@ static int __init resctrl_late_init(void)
11001100
return 0;
11011101
}
11021102

1103-
late_initcall(resctrl_late_init);
1103+
late_initcall(resctrl_arch_late_init);
11041104

1105-
static void __exit resctrl_exit(void)
1105+
static void __exit resctrl_arch_exit(void)
11061106
{
11071107
struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_L3].r_resctrl;
11081108

11091109
cpuhp_remove_state(rdt_online);
11101110

1111-
rdtgroup_exit();
1111+
resctrl_exit();
11121112

11131113
if (r->mon_capable)
11141114
rdt_put_mon_l3_config();
11151115
}
11161116

1117-
__exitcall(resctrl_exit);
1117+
__exitcall(resctrl_arch_exit);

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,6 @@ extern struct list_head rdt_all_groups;
328328

329329
extern int max_name_width;
330330

331-
int __init rdtgroup_init(void);
332-
void __exit rdtgroup_exit(void);
333-
334331
/**
335332
* struct rftype - describe each file in the resctrl file system
336333
* @name: File name

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ static int dom_data_init(struct rdt_resource *r)
10271027
/*
10281028
* RESCTRL_RESERVED_CLOSID and RESCTRL_RESERVED_RMID are special and
10291029
* are always allocated. These are used for the rdtgroup_default
1030-
* control group, which will be setup later in rdtgroup_init().
1030+
* control group, which will be setup later in resctrl_init().
10311031
*/
10321032
idx = resctrl_arch_rmid_idx_encode(RESCTRL_RESERVED_CLOSID,
10331033
RESCTRL_RESERVED_RMID);

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4235,14 +4235,14 @@ void resctrl_offline_cpu(unsigned int cpu)
42354235
}
42364236

42374237
/*
4238-
* rdtgroup_init - rdtgroup initialization
4238+
* resctrl_init - resctrl filesystem initialization
42394239
*
42404240
* Setup resctrl file system including set up root, create mount point,
4241-
* register rdtgroup filesystem, and initialize files under root directory.
4241+
* register resctrl filesystem, and initialize files under root directory.
42424242
*
42434243
* Return: 0 on success or -errno
42444244
*/
4245-
int __init rdtgroup_init(void)
4245+
int __init resctrl_init(void)
42464246
{
42474247
int ret = 0;
42484248

@@ -4290,7 +4290,7 @@ int __init rdtgroup_init(void)
42904290
return ret;
42914291
}
42924292

4293-
void __exit rdtgroup_exit(void)
4293+
void __exit resctrl_exit(void)
42944294
{
42954295
debugfs_remove_recursive(debugfs_resctrl);
42964296
unregister_filesystem(&rdt_fs_type);

include/linux/resctrl.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,4 +402,7 @@ void resctrl_arch_reset_rmid_all(struct rdt_resource *r, struct rdt_mon_domain *
402402
extern unsigned int resctrl_rmid_realloc_threshold;
403403
extern unsigned int resctrl_rmid_realloc_limit;
404404

405+
int __init resctrl_init(void);
406+
void __exit resctrl_exit(void);
407+
405408
#endif /* _RESCTRL_H */

0 commit comments

Comments
 (0)