Re: [PATCH v8 1/7] x86/resctrl: Prepare for per-ctrl_mon group mba_MBps control
From: Tony Luck
Date: Fri Nov 01 2024 - 18:40:33 EST
On Fri, Nov 01, 2024 at 03:03:32PM -0700, Fenghua Yu wrote:
> > diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
> > index b681c2e07dbf..5b55a7ac7013 100644
> > --- a/arch/x86/kernel/cpu/resctrl/core.c
> > +++ b/arch/x86/kernel/cpu/resctrl/core.c
> > @@ -958,6 +958,11 @@ static __init bool get_rdt_mon_resources(void)
> > if (rdt_cpu_has(X86_FEATURE_CQM_MBM_LOCAL))
> > rdt_mon_features |= (1 << QOS_L3_MBM_LOCAL_EVENT_ID);
> > + if (rdt_mon_features & (1 << QOS_L3_MBM_LOCAL_EVENT_ID))
>
> Please change this check to:
>
> if (is_mbm_local_enabled())
>
> > + mba_mbps_default_event = QOS_L3_MBM_LOCAL_EVENT_ID;
> > + else if (rdt_mon_features & (1 << QOS_L3_MBM_TOTAL_EVENT_ID))
>
> and this check to:
>
> else if (is_mbm_total_enabled())
>
> > + mba_mbps_default_event = QOS_L3_MBM_TOTAL_EVENT_ID;
> > +
You are correct. I had a moment of amnesia and forgot those
helpers existed and just pasted the expressions used to set
each of the bits in rdt_mon_features.
I will change as you suggest.
-Tony