Re: [PATCH v2 4/5] x86/topo: Fix SNC topology mess

From: Ingo Molnar

Date: Tue Mar 03 2026 - 07:26:03 EST



* Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> +static u32 slit_cluster_package(int N)
> +{
> + int u = topology_num_nodes_per_package();
> + u32 pkg_id = ~0;
> +
> + for (int n = 0; n < u; n++) {
> + const struct cpumask *cpus = cpumask_of_node(N + n);
> + int cpu;
> +
> + for_each_cpu(cpu, cpus) {
> + u32 id = topology_logical_package_id(cpu);
> + if (pkg_id == ~0)
> + pkg_id = id;

Nit: newline after the 'id' local variable definition.

> + /*
> + * Off-trace cluster.
> + *
> + * Notably average out the symmetric pair of off-trace clusters to
> + * ensure the resulting SLIT table is symmetric.
> + */
> + x = i - (i % u);
> + y = j - (j % u);

AFAICS that's an open-coded rounddown() from <linux/math.h>:

x = rounddown(i, u);
y = rounddown(j, u);

right?

With these addressed:

Reviewed-by: Ingo Molnar <mingo@xxxxxxxxxx>

Thanks,

Ingo