Re: [RESEND PATCH v4 04/15] fs/resctrl: Introduce kernel mode (kmode) data structures

Babu Moger <[email protected]>
Newsgroups org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Hi Reinette,

On 8/12/26 18:28, Reinette Chatre wrote:
> Hi Babu,
> 
> On 8/12/26 12:58 PM, Moger, Babu wrote:
>> On 8/10/2026 10:03 PM, Reinette Chatre wrote:
>>> On 7/7/26 2:50 PM, Babu Moger wrote:
> 
>>>> can report what is active or what the platform supports.
>>>>
>>>> Introduce enum resctrl_kernel_mode:
>>>>     - INHERIT_CTRL_AND_MON: Kernel work inherits allocation and monitoring
>>>>       from the user task (current behavior).
>>>
>>> The issue with this "combination" mode becomes obvious in patch 7. I also
>>> see that sashiko hinted at this issue but I am not able to see from your response
>>> what the plan is to address this. As highlighted by patch 7 and sashiko the
>>> "allocation" and "monitoring" features of a system are independent - a system
>>> need not support/enable both. This should be easy to reproduce by, for example,
>>> booting a system with needed rdt= options disabling allocation or monitoring
>>> features.
>>>
>>> I think it will be unexpected to a user on an allocation-only system to
>>> see interface like:
>>>
>>>    # cat info/kernel_mode
>>>     [inherit_ctrl_and_mon]
>>>     global_assign_ctrl_inherit_mon_per_cpu:group=uninitialized
>>>     global_assign_ctrl_assign_mon_per_cpu:group=uninitialized
>>>
>>> Should it not rather be, for example:
>>>    # cat info/kernel_mode
>>>     [inherit_ctrl]
>>>     global_assign_ctrl_per_cpu:group=uninitialized
>>>
>>> Similarly the user input would not need to provide a monitor group when system
>>> only supports allocation.
>>
>> Ok. Yea. We need to separate control and monitor separately.
>>
>>
>> How about something like this?
>>
>>   # cat info/kernel_mode
>>     [ctrl=inherit,mon=inherit]
>>     ctrl=assign,mon=inherit:group=uninitialized
>>     ctrl=assign,mon=assign:group=uninitialized
>>     ctrl=inherit,mon=assign:group=uninitialized
>>
>> If allocation(ctrl) is only supported.
>>
>>   # cat info/kernel_mode
>>     [ctrl=inherit]
>>     ctrl=assign:group=uninitialized
>>
>> If monitor (mon) is only supported.
>>
>>   # cat info/kernel_mode
>>     [mon=inherit]
>>     mon=assign:group=uninitialized
>>
>>
> 
> Please always keep in mind all the requirements and use cases we learned about
> during and after RFC v1 of this work.
> 
> For example, we already know that "per group" assignment is something resctrl
> needs to be ready for. Consider the example in
> https://lore.kernel.org/lkml/[email protected]/
> 
> There may even be "per task" assignment in the future.

Yes. That is correct.

> 
> Constraining this feature to PLZA will make it harder to enable the capabilities
> that we know resctrl need to support in the future.
> 
> This is how we originally landed on the "global" assignment distinction
> (https://lore.kernel.org/lkml/[email protected]/)
> "global assignment" should be kept or replaced with a solution that continues to
> prepare resctrl for these other capabilities.

Yes. Makes sense.

> 
> I am not able to see how resctrl could support "per group" assignment with the
> interface you propose above. If I am missing this, please highlight the solution.
> 
> resctrl may need to explicitly split kernel mode from kernel mode properties. For
> example, below shows an "assign_global_enable_per_cpu" as the kernel mode, now with three
> properties:
> - "ctrl" - could be "assign" or "inherit"
> - "mon" - could be "assign" or "inherit"
> - "group" - required if "ctrl" or "mon" is set to "assign"

ok.


> 
>     # cat info/kernel_mode
>     [inherit]
>     assign_global_enable_per_cpu:ctrl=assign;mon=assign;group=uninitialized

Shouldn't this be like below when default is inherit?

# cat info/kernel_mode
[inherit]
assign_global_enable_per_cpu


When the default changes to assign_global_enable_per_cpu:

# cat info/kernel_mode
inherit 
[assign_global_enable_per_cpu:ctrl=assign;mon=assign;group=ctrl_mon1//]

Display the second mode with properties only when group is associated 
with it?

# cat info/kernel_mode
inherit
[assign_global_enable_per_cpu:mon=assign;group=ctrl1/mon1/]


> 
> When resctrl needs to support "per-group" assignment "kernel_mode" could contain
> below with supporting documentation noting which per-resource group files will
> appear when "assign_per_group" is selected that user space can use to manage
> the assignments.
> 
>     # cat info/kernel_mode
>     [inherit]
>     assign_per_group
> 

I know it is future. What could be difference between 
assign_global_enable_per_cpu and assign_per_group?

Thanks

Babu
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.