Re: [PATCH v6 1/9] x86/topology: Export topo_lookup_cpuid() for resctrl use

From: Chen Yu

Date: Fri Aug 21 2026 - 00:16:54 EST


Hi Reinette,

On Wed, Aug 19, 2026 at 03:55:36PM -0700, Reinette Chatre wrote:
> Hi Chenyu,
>
> On 7/25/26 2:22 AM, Chen Yu wrote:
> > Enhanced RDT (ERDT) enumerates its monitoring and control resources
>
> Please use at least 80 characters per line. The checkpatch warnings about 75
> characters can be ignored. For context, please see
> https://lore.kernel.org/lkml/20250916105447.GCaMlB976WLxHHeNMD@fat_crate.local/
>
> Please check entire series.
>

Got it, will check and fix them accordingly.

> > through ACPI tables that identify each CPU by its x2APIC ID. To
> > associate this firmware-provided data with the kernel's per-CPU
> > structures, ERDT must translate those x2APIC IDs into logical CPU
> > numbers.
> >
> > topo_lookup_cpuid() already performs this translation, but it is
> > static to topology.c and therefore not reachable from resctrl.
> >
> > Export topo_lookup_cpuid() and add its declaration to asm/apic.h so
>
> To support this change you could add a motivation why this particular
> header file was chosen. For example,
> "add its declaration to asm/apic.h" -> "add its declaration to asm/apic.h
> that already exposes the inverse mapping"
>

OK, will adjust it.

> > that ERDT can resolve x2APIC IDs from ACPI tables to logical CPU
> > numbers.
> >
> > No functional change intended.
> >
> > Signed-off-by: Chen Yu <yu.c.chen@xxxxxxxxx>
> > Tested-by: Hongyu Ning <hongyu.ning@xxxxxxxxxxxxxxx>
> > ---
>
> | Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>
>

Thanks!

Chenyu

> Reinette