Re: [PATCH v13 25/32] x86/resctrl: Handle number of RMIDs supported by RDT_RESOURCE_PERF_PKG

Luck, Tony
2025-11-14T21:56:02Z

On Thu, Nov 13, 2025 at 02:51:45PM -0800, Reinette Chatre wrote:
> > static bool enable_events(struct event_group *e, struct pmt_feature_group *p)
> > {
> > + struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_PERF_PKG].r_resctrl;
> > +
> > if (!group_has_usable_regions(e, p))
> > return false;
> >
> > + /* Disable feature if insufficient RMIDs */
> > + if (!all_regions_have_sufficient_rmid(e, p))
> > + rdt_set_feature_disabled(e->name);
> > +
> > + /* User can override above disable from kernel command line */
> > + if (!rdt_is_feature_enabled(e->name))
> > + return false;
>
> Considering this from the user's perspective I do not think there is an easy way for user space
> to know that the feature was force disabled and that there is an option to override this.
> What is the use case considered here? If I understand correctly there may be a way to deduce this
> by consulting files in /sys/class/intel_pmt/ where the telemetry regions' number of supported
> RMID is printed. A user can compare that to the XML files to determine that there is an issue
> that can explain resctrl not exposing the feature. Considering this difficulty I wonder if it
> may be helpful to print an error message here? This is of course not perfect since the kernel
> log cannot be guaranteed to forever contain it ... but it may help?

Reinette,

Good idea. Here's a draft. Comments welcome to improve the user message
that would look like:

resctrl: Feature energy guid=0x26696143 not enabled due to insufficient RMIDs

static bool enable_events(struct event_group *e, struct pmt_feature_group *p)
{
struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_PERF_PKG].r_resctrl;
bool warn_disable = false;

if (!group_has_usable_regions(e, p))
return false;

/* Disable feature if insufficient RMIDs */
if (!all_regions_have_sufficient_rmid(e, p)) {
warn_disable = true;
rdt_set_feature_disabled(e->name);
}

/* User can override above disable from kernel command line */
if (!rdt_is_feature_enabled(e->name)) {
if (warn_disable)
pr_info("Feature %s guid=0x%x not enabled due to insufficient RMIDs\n",
e->name, e->guid);
return false;
}
...
}

-Tony