Re: [PATCH v5 RESEND 7/7] fs/resctrl: Add info/moveable_mon_group

From: Reinette Chatre

Date: Mon Nov 23 2026 - 12:51:59 EST


Hi Ben,

On 11/12/26 9:16 AM, Ben Horgan wrote:
> On 12/11/2026 01:42, Jinjie Ruan wrote:
>> 在 2026/11/12 2:34, Reinette Chatre 写道:
>>> On 11/10/26 5:39 AM, Jinjie Ruan wrote:
>>>> Moving a MON group into the mon_groups directory of another CTRL_MON
>>>> group changes the CLOSID of the group while its RMID stays the same.
>>>> Where the RMID is only meaningful together with the CLOSID, as on arm64
>>>> MPAM, the move changes the RMID index of the group and is rejected with
>>>> -EOPNOTSUPP.
>>>>
>>>> Userspace cannot tell whether the move is supported without trying it.
>>>> Add "info/moveable_mon_group", which reads 1 when a MON group can be
>>>> moved to another CTRL_MON group and 0 when the move is rejected, and
>>>> refer to it where resctrl.rst describes the move.
>>>>
>>>> Suggested-by: Ben Horgan <ben.horgan@xxxxxxx>
>>>> Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
>>>
>>> Do you find that this binary "supported/unsupported" accurately captures
>>
>> I think this behavior is deterministic on MPAMv1, so that's enough for mpam.
>>
>>> everything that MPAM may ever want to do in this area? Could it be that, for
>>
>> That would be what the new version of MPAM does (such as v2 mentioned
>> below), the behavior of the mapmv1 version is already determined..
>>
>>> example, one day MPAM may be asked to support the move of a monitor group to
>>> support scenarios where the reset of monitor counts is acceptable to the customer
>>> and availability of PMG will be managed as part of the scenario needing support?
>
> For such a destructive move I would have thought it would be better to
> forbid the move and just rely on the user deleting the existing monitor
> group and creating a new one at the new location. If we consider only
> llc_occupancy on MPAM, which isn't affected by any requirement to be
> free running as effectively the hardware re-measures the cache occupancy
> on each read, then allowing monitor groups to be moved still gives a
> misleading impression to the users. The actual cache occupancy of the
> tasks in the moved monitor group stays the same but only the cache lines
> allocated after the move with the new (PARTID, PMG) association are
> accounted for in llc_occupancy. The tasks still get cache hits for the
> lines allocated previous to the monitor group move.
>
> Having said that, one problem with relying on deleting and creating a
> new monitor group is that you have to keep track of the associated tasks
> which isn't necessarily straight forward, e.g. when a child task is
> started after deleting the monitor group.
>
> Any relaxation of expectations of what happens when a monitor group is
> moved would need explicit buy-in from the user as otherwise they could
> rightly expect the established resctrl behaviour.

Exactly. Hence the idea of this potentially needing support via a resctrl
interface. This is hypothetical. I am not advocating for adding this
support but instead advocating that this feature keeps extensibility in mind.

All the caveats you list are valid. Even so, consider, for example, your
point about the impact on LLC occupancy: When I look at a feature like PLZA
that supports a customer request [1] that only seems to consider memory bandwidth
it does not seem as though LLC occupancy is always of concern since PLZA
assigns a global CLOSID for _all_ kernel mode work, including cache allocation.

>
> I haven't understood the reason why groups that monitor cpus can't be
> moved. Is this impossible to implement even on an x86 system? Why can't
> the cpus move move between control groups in the way that tasks do?

resctrl has a contract that MON groups may only include CPUs that belong to
its parent CTRL_MON group. Simply moving the MON group with its CPU will thus
break that contract, unless its CPUs are moved with it to the new control group.
The implementation of the feature stopped short of making such a significant change
for which I do not think there was a use case at the time.

Reinette

[1] https://lore.kernel.org/lkml/3c3029e61d4602476b7836d82614ba4ec71b3a99.1769029977.git.babu.moger@xxxxxxx/