Re: [PATCH v7 06/24] x86/resctrl: Access per-rmid structures by index

From: Reinette Chatre
Date: Thu Nov 09 2023 - 12:42:46 EST


Hi James,

On 10/25/2023 11:03 AM, James Morse wrote:


...
> diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
> index 0056c9962a44..fc70a2650729 100644
> --- a/arch/x86/kernel/cpu/resctrl/core.c
> +++ b/arch/x86/kernel/cpu/resctrl/core.c
> @@ -589,7 +589,7 @@ static void domain_remove_cpu(int cpu, struct rdt_resource *r)
> mbm_setup_overflow_handler(d, 0);
> }
> if (is_llc_occupancy_enabled() && cpu == d->cqm_work_cpu &&
> - has_busy_rmid(r, d)) {
> + has_busy_rmid(d)) {
> cancel_delayed_work(&d->cqm_limbo);
> cqm_setup_limbo_handler(d, 0);
> }
> @@ -604,7 +604,8 @@ static void clear_closid_rmid(int cpu)
> state->default_rmid = 0;
> state->cur_closid = 0;
> state->cur_rmid = 0;

These assignments can also use the new RESERVED defines, no?

> - wrmsr(MSR_IA32_PQR_ASSOC, 0, 0);
> + wrmsr(MSR_IA32_PQR_ASSOC, RESCTRL_RESERVED_RMID,
> + RESCTRL_RESERVED_CLOSID);
> }
>


Looks like rdtgroup_setup_default() is also a candidate to replace
hardcoded "0" for closid and rmid with the new defines.


...

> @@ -670,7 +703,7 @@ void cqm_handle_limbo(struct work_struct *work)
>
> __check_limbo(d, false);
>
> - if (has_busy_rmid(r, d))
> + if (has_busy_rmid(d))
> schedule_delayed_work_on(cpu, &d->cqm_limbo, delay);
>

This change results in a new compile warning:

arch/x86/kernel/cpu/resctrl/monitor.c: In function ‘cqm_handle_limbo’:
arch/x86/kernel/cpu/resctrl/monitor.c:805:30: warning: variable ‘r’ set but not used [-Wunused-but-set-variable]
805 | struct rdt_resource *r;


Reinette