Re: [PATCH v4 08/39] x86/resctrl: Generate default_ctrl instead of sharing it

From: Reinette Chatre
Date: Wed Aug 14 2024 - 00:01:02 EST


Hi James,

On 8/2/24 10:28 AM, James Morse wrote:

+/**
+ * resctrl_get_default_ctrl() - Return the default control value for this
+ * resource.
+ * @r: The resource whose default control type is queried.
+ */
+static inline u32 resctrl_get_default_ctrl(struct rdt_resource *r)
+{
+ switch (r->schema_fmt) {
+ case RESCTRL_SCHEMA_BITMAP:
+ return BIT_MASK(r->cache.cbm_len) - 1;
+ case RESCTRL_SCHEMA_PERCENTAGE:
+ return 100u;
+ case RESCTRL_SCHEMA_MBPS:
+ return r->membw.max_bw;
+ }
+
+ return WARN_ON_ONCE(1);
+}
+

I am concerned where this is headed. Since RESCTRL_SCHEMA_PERCENTAGE remains
in use when resctrl is mounted with mba_MBps the default cannot always
be 100u (it should be MBA_MAX_MBPS when software controller is active).

Reinette