Re: [PATCH v2] sched/topology: Check average distances to remote packages

Peter Zijlstra
2026-02-25T15:44:22Z

On Wed, Feb 25, 2026 at 11:39:54PM +0800, Chen, Yu C wrote:

> > +static int slit_cluster_distance(int i, int j)
> > +{
> > + static int u = 0;
> > + long d = 0;
> > + int x, y;
> > +
> > + if (!u)
> > + u = slit_cluster_size();
> > +
> > + /*
> > + * Is this a unit cluster on the trace?
> > + */
> > + if ((i / u) == (j / u))
> > + return node_distance(i, j);
>
> the u is 3 in above example, because slit_cluster_size()
> found that node0, node1 and node2 are in the same biggest
> symmetric cluster.

> Not sure if I understand it correctly,
> here we will treat node4 and node5 as the same cluster,
> but without checking whether node_distance(4, 5) and
> node_distance(5,4) are the same. If node_dist(4,5)!=node_dist(5,4),
> will we keep it as it is?

Yes, so this assumes that all u sized clusters on the trace are similar
and 'sane' without verification.