Re: [PATCH v3 07/21] x86/resctrl: Create mba_sc configuration in the rdt_domain

From: James Morse
Date: Wed Mar 30 2022 - 12:43:37 EST


Hi Reinette,

On 05/03/2022 00:26, Reinette Chatre wrote:
> On 2/17/2022 10:20 AM, James Morse wrote:
>> To support resctrl's MBA software controller, the architecture must provide
>> a second configuration array to hold the mbps_val[] from user-space.
>>
>> This complicates the interface between the architecture specific code and
>> the filesystem portions of resctrl that will move to /fs/, to allow
>> multiple architectures to support resctrl.
>>
>> Make the filesystem parts of resctrl create an array for the mba_sc
>> values when is_mba_sc() is set to true. The software controller
>> can be changed to use this, allowing the architecture code to only
>> consider the values configured in hardware.

...

>> @@ -3263,6 +3295,9 @@ void resctrl_offline_domain(struct rdt_resource *r, struct rdt_domain *d)
>> cancel_delayed_work(&d->cqm_limbo);
>> }
>>
>> + if (is_mba_sc(r))
>> + mba_sc_domain_destroy(r, d);
>> +
>> domain_destroy_mon_state(d);
>> }
>>
>> @@ -3309,6 +3344,12 @@ int resctrl_online_domain(struct rdt_resource *r, struct rdt_domain *d)
>> if (err)
>> return err;
>>
>> + err = mba_sc_domain_allocate(r, d);
>> + if (err) {
>> + domain_destroy_mon_state(d);
>> + return err;
>> + }
>> +

> Thank you for making this all symmetrical. It seems as though the new
> array is always created but only destroyed when is_mba_sc() is true.
> Is this correct?

That looks broken. Oops.

I'll fix it to always allocate the array, as that is what domain_setup_ctrlval() does
today, and it saves the hotplug headache.


Thanks,

James