Re: [PATCH v6 09/42] x86/resctrl: Add helper for setting CPU default properties

From: Reinette Chatre
Date: Wed Feb 19 2025 - 18:10:35 EST


Hi James,

On 2/7/25 10:17 AM, James Morse wrote:
> rdtgroup_rmdir_ctrl() and rdtgroup_rmdir_mon() set the per-CPU
> pqr_state for CPUs that were part of the rmdir()'d group.
>
> Another architecture might not have a 'pqr_state', its hardware may
> need the values in a different format. MPAM's equivalent of RMID values
> are not unique, and always need the CLOSID to be provided too.
>
> There is only one caller that modifies a single value,
> (rdtgroup_rmdir_mon()). MPAM always needs both CLOSID and RMID
> for the hardware value as these are written to the same system
> register.
>
> As rdtgroup_rmdir_mon() has the CLOSID on hand, only provide a
> helper to set both values. These values are read by
> __resctrl_sched_in(), but may be written by a different CPU without
> any locking, add READ/WRTE_ONCE() to avoid torn values.
>
> Co-developed-by: Dave Martin <Dave.Martin@xxxxxxx>
> Signed-off-by: Dave Martin <Dave.Martin@xxxxxxx>
> Signed-off-by: James Morse <james.morse@xxxxxxx>
> Tested-by: Carl Worth <carl@xxxxxxxxxxxxxxxxxxxxxx> # arm64
> Tested-by: Shaopeng Tan <tan.shaopeng@xxxxxxxxxxxxxx>
> Reviewed-by: Shaopeng Tan <tan.shaopeng@xxxxxxxxxxxxxx>
> Reviewed-by: Tony Luck <tony.luck@xxxxxxxxx>
> ---

Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>

Reinette