Re: [RFC PATCH 05/31] x86/resctrl: Parse ACPI CMRC table

"Luck, Tony" <[email protected]>
Newsgroups gmane.linux.kernel
Message-ID <anIrzyBugJSJSl99@agluck-desk3>
On Tue, Aug 04, 2026 at 10:19:26AM -0700, Luck, Tony wrote:
> On Mon, Aug 03, 2026 at 12:03:48AM +0800, Chen Yu wrote:

> >  
> > +/* Scale to bytes for the monitoring counters when ERDT is enabled. */
> > +static int erdt_scale;
> 
> Single value for scale? See below.

Now I've read ahead to patch 9 and see how this is used to set
resctrl_rmid_realloc_threshold. Needs better comments here and
for above erdt_get_scale()
> 
> > +
> >  int erdt_get_max_rmid(void)
> >  {
> >  	return erdt_max_rmid;
> >  }
> >  
> > +int erdt_get_scale(void)
> > +{
> > +	return erdt_scale;
> > +}
> > +
> > +	erdt_scale = max_t(int, erdt_scale, cmrc->up_scale);
> 
> I'd expect that on a machine all CMRC tables would report the same
> up_scale factor. But RDT architecture allows them to be different. Two
> ways to handle this:
> 
> 1) Check that they are all the same. Complain if they are different and
> don't enable cache occupancy events.
> 
> 2) Save the value for each domain and use that value to upscale when
> reporting to user.

I see in patch 9 that you do use this option "2" with "cmrc->up_scale".

> Picking the max value doesn't feel like a good answer.

Given how this is actually used, seems like the best option.
> 
> > +
> > +	return 0;
> > +}
> 
-Tony
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.