Re: [RFC v2] arm,x86,fs/resctrl: Generic schema description Proof of Concept
From: Reinette Chatre
Date: Thu Aug 06 2026 - 13:12:49 EST
Hi Tony,
On 8/6/26 10:04 AM, Luck, Tony wrote:
> On Wed, Aug 05, 2026 at 04:57:04PM -0700, Reinette Chatre wrote:
>> Hi Ben,
>>
>> On 8/5/26 9:59 AM, Ben Horgan wrote:
>>> Just given a go at running this on a model with MPAM and I can mount resctrl with this
>>> small patch to initialise the emulated_by lists so that list_empty() behaves.
>>>
>>> diff --git a/drivers/resctrl/mpam_resctrl.c b/drivers/resctrl/mpam_resctrl.c
>>> index 21dcbf5764cc..638095649151 100644
>>> --- a/drivers/resctrl/mpam_resctrl.c
>>> +++ b/drivers/resctrl/mpam_resctrl.c
>>> @@ -1018,6 +1018,7 @@ static int mpam_resctrl_control_init(struct mpam_resctrl_res *res)
>>> case RDT_RESOURCE_L3:
>>> mpam_ctrl->r_ctrl.type = RESCTRL_CTRL_BITMAP;
>>> mpam_ctrl->r_ctrl.name = RESCTRL_CTRL_NAME_DEF;
>>> + INIT_LIST_HEAD(&mpam_ctrl->r_ctrl.emulated_by);
>>> INIT_LIST_HEAD_RCU(&mpam_ctrl->r_ctrl.domains);
>>> __set_bit(RESCTRL_BITMAP_FLAG_SPARSE, mpam_ctrl->r_ctrl.bitmap.flags);
>>> mpam_ctrl->r_ctrl.bitmap.cbm_len = class->props.cpbm_wd;
>>> @@ -1048,6 +1049,7 @@ static int mpam_resctrl_control_init(struct mpam_resctrl_res *res)
>>> r->ctrl_scope = RESCTRL_L3_CACHE;
>>> mpam_ctrl->r_ctrl.type = RESCTRL_CTRL_SCALAR;
>>> mpam_ctrl->r_ctrl.name = RESCTRL_CTRL_NAME_DEF;
>>> + INIT_LIST_HEAD(&mpam_ctrl->r_ctrl.emulated_by);
>>> INIT_LIST_HEAD_RCU(&mpam_ctrl->r_ctrl.domains);
>>>
>>> r->bw_throttle_mode = THREAD_THROTTLE_UNDEFINED;
>>
>> Thank you for this. Added this and it is now available in branch resctrl/controls_rfc_v2.1
>
> Is same needed for x86? I don't see any initialization of the
> "r_ctrl.emulated_by" lists in similar initialization functions.
x86 "emulated_by" list initialization should be in both branches.
Branch resctrl/controls_rfc_v2.1 combined all "emulated_by" list initialization
(for x86 and MPAM) into commit:
3407e523c988 ("fs/resctrl: Introduce emulated controls and control mode")
In the original resctrl/controls_rfc_v2 the x86 "emulated_by" list initialization can
be found in commit fbed64f80515 ("x86/resctrl: SAMPLE: Emulated controls")
Reinette