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

From: James Morse
Date: Wed Dec 13 2023 - 13:04:34 EST


Hi Reinette,

On 09/11/2023 17:42, Reinette Chatre wrote:
> 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
>> @@ -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?

Yup, done.

>> - 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.

Sure, done.


>> @@ -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;

Hmm, looks like the assignment foxes gcc-12 into thinking this is okay.
I've removed that now.


Thanks,

James