Re: [RFC PATCH 1/3] fork,arm,x86,fs/resctrl: Fix stale resource group assignment vs copy_process()

From: Ben Horgan

Date: Tue Nov 24 2026 - 05:09:07 EST


Hi Reinette,

On 24/11/2026 00:43, Reinette Chatre wrote:
> Hi Ben,
>
> Thank you very much for taking a look.
>
> On 11/23/26 6:14 AM, Ben Horgan wrote:
>> On 20/11/2026 18:39, Reinette Chatre wrote:
>>>
>>> - A static inline in include/linux/arm_mpam.h, beside the
>>> resctrl_arch_*() inlines already there. asm/mpam.h includes
>>> linux/arm_mpam.h, so the reverse include would be circular and
>>
>> Hmm, the existing include of linux/arm_mpam.h appears to be unnecessary.
>
> ah, I see. I can include a preparatory patch that removes it.
>
>> As such, that include can be removed and resctrl_arch_copy_closid_rmid()
>> could be a static inline in include/linux/arm_mpam.h.
>
> As a follow up, do you prefer include/linux/arm_mpam.h to contain the
> full implementation like below, which is the first access of mpam_partid_pmg
> outside arch/arm64/include/asm/mpam.h:
>
> static inline void resctrl_arch_copy_closid_rmid(struct task_struct *dst,
> struct task_struct *src)
> {
> WRITE_ONCE(task_thread_info(dst)->mpam_partid_pmg, mpam_get_regval(src));
> }
>
> or, do you prefer to contain all users of mpam_partid_pmg in
> arch/arm64/include/asm/mpam.h and thus instead implement solution as:

Yes. The second option looks best to me.

Thanks,

Ben

>
> arch/arm64/include/asm/mpam.h:
> static inline void mpam_copy_task_partid_pmg(struct task_struct *dst,
> struct task_struct *src)
> {
> WRITE_ONCE(task_thread_info(dst)->mpam_partid_pmg, mpam_get_regval(src));
> }
>
> include/linux/arm_mpam.h:
> static inline void resctrl_arch_copy_closid_rmid(struct task_struct *dst,
> struct task_struct *src)
> {
> mpam_copy_task_partid_pmg(dst, src);
> }
>
> Reinette