Re: [PATCH v6 1/3] x86/resctrl: Add mount option "mba_MBps_event"

From: Tony Luck
Date: Fri Dec 08 2023 - 16:50:44 EST


On Fri, Dec 08, 2023 at 12:29:18PM -0600, Moger, Babu wrote:
> Hi Tony,
>
> On 12/7/2023 1:56 PM, Tony Luck wrote:
> > -static int set_mba_sc(bool mba_sc)
> > +static int set_mba_sc(bool mba_sc, enum resctrl_event_id mba_mbps_event)
> > {
> > struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl;
> > u32 num_closid = resctrl_arch_get_num_closid(r);
> > @@ -2313,6 +2313,7 @@ static int set_mba_sc(bool mba_sc)
> > return -EINVAL;
> > r->membw.mba_sc = mba_sc;
> > + r->membw.mba_mbps_event = mba_mbps_event;
> > list_for_each_entry(d, &r->domains, list) {
> > for (i = 0; i < num_closid; i++)
> > @@ -2445,13 +2446,14 @@ static void rdt_disable_ctx(void)
> > {
> > resctrl_arch_set_cdp_enabled(RDT_RESOURCE_L3, false);
> > resctrl_arch_set_cdp_enabled(RDT_RESOURCE_L2, false);
> > - set_mba_sc(false);
> > + set_mba_sc(false, QOS_L3_MBM_LOCAL_EVENT_ID);
>
> This is kind of miss leading. Why do you pass "QOS_L3_MBM_LOCAL_EVENT_ID"
> here?
>
> If you move the following initialization to rdt_enable_ctx, then you don't
> need to pass the second argument.
>
> r->membw.mba_mbps_event = mba_mbps_event;

Babu,

Yes. That was funky. I will drop the second argumen to set_mba_sc() and
move the initialization to rdt_enable_ctx()

Thnaks for the review.

-Tony