Re: [PATCH v7 05/12] x86/resctrl: Detect and configure Slow Memory Bandwidth allocation

Moger, Babu
2022-10-26T19:10:14Z

Hi Reinette,

On 10/25/22 18:43, Reinette Chatre wrote:
> Hi Babu,
>
> Nitpick in Subject ... "allocation" -> "Allocation"?
Sure.
>
> On 10/17/2022 3:26 PM, Babu Moger wrote:
>
> ...
>
>> @@ -2845,7 +2846,8 @@ static int rdtgroup_init_alloc(struct rdtgroup *rdtgrp)
>>
>> list_for_each_entry(s, &resctrl_schema_all, list) {
>> r = s->res;
>> - if (r->rid == RDT_RESOURCE_MBA) {
>> + if (r->rid == RDT_RESOURCE_MBA ||
>> + r->rid == RDT_RESOURCE_SMBA) {
>> rdtgroup_init_mba(r, rdtgrp->closid);
>> if (is_mba_sc(r))
>> continue;
> The above hunk and the ones that follow are unexpected.

I am thinking the above check is required, It is updating the
staged_config with default values. Right now, the default value for SMBA
is same as MBA default value. So, I used this code to initialize.

Did I miss something?

>
> Note that the software controller, when resctrl is mounted with "mba_MBps", is
> only supported by RDT_RESOURCE_MBA. At this time this really is hard coded all
> over the place, for example:
>
> static int set_mba_sc(bool mba_sc)
> {
> struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl;
> ...
>
> }
>
> Since SMBA hardcodes "delay_linear = false" I do not expect it to support the software
> controller ... but these hunks appear to treat SMBA as though it does. It is the "MBA software
> controller", not "SMBA software controller". Why does it check above if the MBA software
> controller is enabled on SMBA?

There is no plan to support SMBA software controller. Yes, I think below
checks are not required.

>
>
>> @@ -3287,7 +3289,8 @@ void resctrl_offline_domain(struct rdt_resource *r, struct rdt_domain *d)
>> {
>> lockdep_assert_held(&rdtgroup_mutex);
>>
>> - if (supports_mba_mbps() && r->rid == RDT_RESOURCE_MBA)
>> + if (supports_mba_mbps() &&
>> + (r->rid == RDT_RESOURCE_MBA || r->rid == RDT_RESOURCE_SMBA))
>> mba_sc_domain_destroy(r, d);
This check is not required.
>>
>> if (!r->mon_capable)
>> @@ -3354,8 +3357,9 @@ int resctrl_online_domain(struct rdt_resource *r, struct rdt_domain *d)
>>
>> lockdep_assert_held(&rdtgroup_mutex);
>>
>> - if (supports_mba_mbps() && r->rid == RDT_RESOURCE_MBA)
>> - /* RDT_RESOURCE_MBA is never mon_capable */
>> + if (supports_mba_mbps() &&
>> + (r->rid == RDT_RESOURCE_MBA || r->rid == RDT_RESOURCE_MBA))
>> + /* RDT_RESOURCE_MBA (or SMBA) is never mon_capable */
> What does this change do? Did you mean to add a r->rid == RDT_RESOURCE_SMBA check?

Good catch. I meant  r->rid == RDT_RESOURCE_SMBA.

But this check is not required at all.

>
>> return mba_sc_domain_allocate(r, d);
>>
>> if (!r->mon_capable)
>>
>>
> Why are the MBA software controller resources allocated/destroyed for a SMBA resource? If
> you want to support the software controller for SMBA then there are a lot of other changes

No..There is no plan to support software controller for SMBA.

Thanks

Babu