Skip to content

Commit 7704fb8

Browse files
James Morsebp3tk0v
authored andcommitted
x86/resctrl: Rename resctrl_sched_in() to begin with "resctrl_arch_"
resctrl_sched_in() loads the architecture specific CPU MSRs with the CLOSID and RMID values. This function was named before resctrl was split to have architecture specific code, and generic filesystem code. This function is obviously architecture specific, but does not begin with 'resctrl_arch_', making it the odd one out in the functions an architecture needs to support to enable resctrl. Rename it for consistency. This is purely cosmetic. 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> Tested-by: Fenghua Yu <fenghuay@nvidia.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> Tested-by: Tony Luck <tony.luck@intel.com> Link: https://lore.kernel.org/20250515165855.31452-7-james.morse@arm.com
1 parent dcb1d3d commit 7704fb8

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

arch/x86/include/asm/resctrl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static inline bool resctrl_arch_match_rmid(struct task_struct *tsk, u32 ignored,
175175
return READ_ONCE(tsk->rmid) == rmid;
176176
}
177177

178-
static inline void resctrl_sched_in(struct task_struct *tsk)
178+
static inline void resctrl_arch_sched_in(struct task_struct *tsk)
179179
{
180180
if (static_branch_likely(&rdt_enable_key))
181181
__resctrl_sched_in(tsk);
@@ -212,7 +212,7 @@ void resctrl_cpu_detect(struct cpuinfo_x86 *c);
212212

213213
#else
214214

215-
static inline void resctrl_sched_in(struct task_struct *tsk) {}
215+
static inline void resctrl_arch_sched_in(struct task_struct *tsk) {}
216216
static inline void resctrl_cpu_detect(struct cpuinfo_x86 *c) {}
217217

218218
#endif /* CONFIG_X86_CPU_RESCTRL */

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ static int rdtgroup_cpus_show(struct kernfs_open_file *of,
376376
}
377377

378378
/*
379-
* This is safe against resctrl_sched_in() called from __switch_to()
379+
* This is safe against resctrl_arch_sched_in() called from __switch_to()
380380
* because __switch_to() is executed with interrupts disabled. A local call
381381
* from update_closid_rmid() is protected against __switch_to() because
382382
* preemption is disabled.
@@ -395,7 +395,7 @@ void resctrl_arch_sync_cpu_closid_rmid(void *info)
395395
* executing task might have its own closid selected. Just reuse
396396
* the context switch code.
397397
*/
398-
resctrl_sched_in(current);
398+
resctrl_arch_sched_in(current);
399399
}
400400

401401
/*
@@ -620,7 +620,7 @@ static void _update_task_closid_rmid(void *task)
620620
* Otherwise, the MSR is updated when the task is scheduled in.
621621
*/
622622
if (task == current)
623-
resctrl_sched_in(task);
623+
resctrl_arch_sched_in(task);
624624
}
625625

626626
static void update_task_closid_rmid(struct task_struct *t)
@@ -678,7 +678,7 @@ static int __rdtgroup_move_task(struct task_struct *tsk,
678678
* Ensure the task's closid and rmid are written before determining if
679679
* the task is current that will decide if it will be interrupted.
680680
* This pairs with the full barrier between the rq->curr update and
681-
* resctrl_sched_in() during context switch.
681+
* resctrl_arch_sched_in() during context switch.
682682
*/
683683
smp_mb();
684684

@@ -2994,8 +2994,8 @@ static void rdt_move_group_tasks(struct rdtgroup *from, struct rdtgroup *to,
29942994
/*
29952995
* Order the closid/rmid stores above before the loads
29962996
* in task_curr(). This pairs with the full barrier
2997-
* between the rq->curr update and resctrl_sched_in()
2998-
* during context switch.
2997+
* between the rq->curr update and
2998+
* resctrl_arch_sched_in() during context switch.
29992999
*/
30003000
smp_mb();
30013001

arch/x86/kernel/process_32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
211211
switch_fpu_finish(next_p);
212212

213213
/* Load the Intel cache allocation PQR MSR. */
214-
resctrl_sched_in(next_p);
214+
resctrl_arch_sched_in(next_p);
215215

216216
return prev_p;
217217
}

arch/x86/kernel/process_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
707707
}
708708

709709
/* Load the Intel cache allocation PQR MSR. */
710-
resctrl_sched_in(next_p);
710+
resctrl_arch_sched_in(next_p);
711711

712712
return prev_p;
713713
}

0 commit comments

Comments
 (0)