Re: [PATCH v3 06/12] fs/resctrl: Initialize the global kernel-mode policy at subsystem init
From: Reinette Chatre
Date: Mon Jun 22 2026 - 12:25:21 EST
Hi Babu,
On 6/18/26 10:14 AM, Babu Moger wrote:
> On 6/16/26 18:36, Reinette Chatre wrote:
>> On 4/30/26 4:24 PM, Babu Moger wrote:
>>
>>> - calls resctrl_arch_get_kmode_support() so each architecture ORs
>>> BIT(<mode>) into kmode for the policies its hardware supports
>>> (on x86, AMD PLZA contributes the two global-assign modes).
>>>
>>> resctrl_kmode_init() runs from resctrl_init() once the default group
>>
>> resctrl_kmode_init() can be dropped after changes described in response
>> to previous patch. Apart from no longer being necessary I also find that
>> having the kernel mode fully initialized *before* the hotplug handlers run
>> to be simpler.
>
> That means resctrl_set_kmode_support() will be called from the architecture layer, likely from core.c within get_rdt_alloc_resources().
>
> The resctrl_set_kmode_support() handler would need to initialize both the default mode and all supported modes.
I see this differently. Since resctrl_set_kmode_support() is optional for an architecture
resctrl fs can just statically initialize the defaults. resctrl_set_kmode_support() would
expand the defaults to also accommodate what the architecture supports.
Reinette