Skip to content

Commit 4bbfc90

Browse files
aeglbp3tk0v
authored andcommitted
x86/resctrl: Enable RDT_RESOURCE_PERF_PKG
Since telemetry events are enumerated on resctrl mount the RDT_RESOURCE_PERF_PKG resource is not considered "monitoring capable" during early resctrl initialization. This means that the domain list for RDT_RESOURCE_PERF_PKG is not built when the CPU hotplug notifiers are registered and run for the first time right after resctrl initialization. Mark the RDT_RESOURCE_PERF_PKG as "monitoring capable" upon successful telemetry event enumeration to ensure future CPU hotplug events include this resource and initialize its domain list for CPUs that are already online. Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Link: https://lore.kernel.org/20251217172121.12030-1-tony.luck@intel.com
1 parent d089164 commit 4bbfc90

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

arch/x86/kernel/cpu/resctrl/core.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,8 +766,24 @@ static int resctrl_arch_offline_cpu(unsigned int cpu)
766766

767767
void resctrl_arch_pre_mount(void)
768768
{
769+
struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_PERF_PKG].r_resctrl;
770+
int cpu;
771+
769772
if (!intel_aet_get_events())
770773
return;
774+
775+
/*
776+
* Late discovery of telemetry events means the domains for the
777+
* resource were not built. Do that now.
778+
*/
779+
cpus_read_lock();
780+
mutex_lock(&domain_list_lock);
781+
r->mon_capable = true;
782+
rdt_mon_capable = true;
783+
for_each_online_cpu(cpu)
784+
domain_add_cpu_mon(cpu, r);
785+
mutex_unlock(&domain_list_lock);
786+
cpus_read_unlock();
771787
}
772788

773789
enum {

arch/x86/kernel/cpu/resctrl/intel_aet.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,12 @@ static bool enable_events(struct event_group *e, struct pmt_feature_group *p)
270270
else
271271
r->mon.num_rmid = e->num_rmid;
272272

273+
if (skipped_events)
274+
pr_info("%s %s:0x%x monitoring detected (skipped %d events)\n", r->name,
275+
e->pfname, e->guid, skipped_events);
276+
else
277+
pr_info("%s %s:0x%x monitoring detected\n", r->name, e->pfname, e->guid);
278+
273279
return true;
274280
}
275281

0 commit comments

Comments
 (0)