Re: [PATCH v2 00/16] fs,x86/resctrl: Add kernel-mode (e.g., PLZA) support to the resctrl subsystem

Luck, Tony
2026-04-21T15:11:34Z

On Mon, Apr 20, 2026 at 05:21:50PM -0700, Reinette Chatre wrote:
> Hi Tony,
>
> On 4/20/26 5:03 PM, Luck, Tony wrote:
> >> The system boots with these default settings:
> >>
> >> # cat info/kernel_mode
> >> [inherit_ctrl_and_mon]
> >> global_assign_ctrl_assign_mon_per_cpu
> >> global_assign_ctrl_inherit_mon_per_cpu
> >>
> >>
> >> At this point, the interface info/kernel_mode_assignment is not visible.
> >>
> >> Next, lets create a new control group:
> >>
> >> # mkdir ctrl1
> >
> > This allocates a CLOSID and an RMID for this group.
> >
> >> We want to designate this group as the new kernel-mode group.
> >>
> >> First operation: Change the mode:
> >>
> >> # echo "global_assign_ctrl_inherit_mon_per_cpu" > info/kernel_mode
> >
> > This mode needs a CLOSID for PLZA, but doesn't need an RMID.
> >
> >> At this stage, only the kernel mode is being changed. However, there is no
> >> way to know which control group the user intends to assign to kernel mode.
> >> All we know here is the selected mode.
> >>
> >> After this operation, the info/kernel_mode_assignment interface should
> >> become visible. But the question is: what should it contain or point to at
> >> this moment?
> >>
> >> # cat info/kernel_mode_assignment
> >> ??
> >>
> >> Next operation: Assign the group
> >>
> >> # echo "ctrl1//" > info/kernel_mode_assignment
> >
> > Now ring0 code is using the CLOSID from the ctrl1 group.
>
> ... and user space tasks also continue to use the CLOSID from the
> ctrl1 group.
> It is up to user space to decide if a group is dedicated to kernel
> mode or not. resctrl does not enforce it.
>
> >
> > But the RMID for this group isn't used.
>
> RMID is still used by user mode that maintains existing behavior concerning
> this group when considering its tasks/cpus/cpus_list files. RMID assigned to this
> group is just not used for kernel mode.

True, that the RMID is used if the user makes assignments using tasks/cpus/cpus_list
for the ctrl1 group. But they might not do that.

>
> >
> > Are we OK with "wasting" an RMID in this way?
>
> How do you see this RMID as "wasted"?

Suppose the user doesn't assign tasks to the ctrl1 group?

Perhaps the resources they want to make available to the kernel do
not exactly match with resources that they want to provide to any
tasks. In this case the RMID is wasted.

> >
> > Maybe it doesn't matter too much for AMD as you would just
> > avoid assigning any counters to this group. But should Intel
> > get around to doing PLZA-like functionality, that's a real
> > loss of an RMID that might be useful elsewhere.
>
> Reinette

-Tony