]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: cpu-topo: fix group-by-cluster policy for disordered clusters
authorWilly Tarreau <w@1wt.eu>
Tue, 13 May 2025 09:40:44 +0000 (11:40 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 13 May 2025 14:48:30 +0000 (16:48 +0200)
commit33d8b006d4bc9d233ed71d5b26fd3c8b499bba82
treec17c250b82d1c7e9b9f04c18e07d08d98b05f3a3
parentf3b9676416662b57d3b6fc1a084ef297efd693f3
BUG/MINOR: cpu-topo: fix group-by-cluster policy for disordered clusters

Some (rare) boards have their clusters in an erratic order. This is
the case for the Radxa Orion O6 where one of the big cores appears as
CPU0 due to booting from it, then followed by the small cores, then the
medium cores, then the remaining big cores. This results in clusters
appearing this order: 0,2,1,0.

The core in cpu_policy_group_by_cluster() expected ordered clusters,
and performs ordered comparisons to decide whether a CPU's cluster has
already been taken care of. On the board above this doesn't work, only
clusters 0 and 2 appear and 1 is skipped.

Let's replace the cluster number comparison with a cpuset to record
which clusters have been taken care of. Now the groups properly appear
like this:

  Tgrp/Thr  Tid        CPU set
  1/1-2     1-2        2: 0,11
  2/1-4     3-6        4: 1-4
  3/1-6     7-12       6: 5-10

No backport is needed, this is purely 3.2.
src/cpu_topo.c