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

From: Chen, Yu C

Date: Wed Aug 05 2026 - 01:00:18 EST


Hi Tony,

On 8/5/2026 2:13 AM, Luck, Tony wrote:
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()

OK, will add comment here.

resctrl_rmid_realloc_threshold is a single global value,
and resctrl_arch_round_mon_val() takes no domain argument, so a
single scale has to be derived from the per-domain cmrc->up_scale.
max() was chosen because the rounding is a floor: a larger scale
yields a slightly lower threshold, i.e. an RMID has to drop to
a slightly lower occupancy before it is reused.


+
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.

OK, the erdt_mon_read() reads via the per domain cmrc->up_scale.

thanks,
Chenyu


+
+ return 0;
+}

-Tony