Re: [PATCH v3 06/12] fs/resctrl: Initialize the global kernel-mode policy at subsystem init

From: Babu Moger

Date: Mon Jun 22 2026 - 12:43:17 EST


Hi Reinette,

On 6/22/26 11:21, Reinette Chatre wrote:
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.

Yes. We can do that.

thanks
Babu