Re: [PATCH v2 07/18] x86/resctrl: Move CLOSID/RMID matching and setting to use helpers

From: Peter Newman
Date: Wed Mar 08 2023 - 05:31:40 EST


Hi James,

On Mon, Mar 6, 2023 at 12:32 PM James Morse <james.morse@xxxxxxx> wrote:
> On 02/02/2023 23:47, Reinette Chatre wrote:
> > On 1/13/2023 9:54 AM, James Morse wrote:
> >> + resctrl_arch_set_closid_rmid(tsk, rdtgrp->closid, rdtgrp->mon.rmid);
> >
> > This does not use the intended closid when rdtgrp->type == RDTMON_GROUP.
>
> Yes, it should be rdtgrp->mon.parent->closid.
>
> rdtgroup_mkdir_mon() initialises them to be the same, I guess its Peter's monitor-group
> rename that means this could get the wrong value?

I noticed this earlier. The next revision of my MON group rename patch
series updates rdtgrp->closid to that of the new parent so that for
MON groups, rdtgrp->closid == rdtgrp->mon.parent->closid continues to
hold.

It looks like rdt_move_group_tasks() assumes this, as it always sets
t->closid to rdtgrp->closid.

-Peter