From: David Carlier Date: Wed, 2 Apr 2025 06:00:44 +0000 (+0100) Subject: MINOR: cpu-topo: cpu_dump_topology() SMT info check little optimisation X-Git-Tag: v3.2-dev9~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a703eeaef75a068557abe0e13cc3c66fe426232a;p=thirdparty%2Fhaproxy.git MINOR: cpu-topo: cpu_dump_topology() SMT info check little optimisation Once we stumble across the first cpu having the criteria, we exit earlier from the loop. --- diff --git a/src/cpu_topo.c b/src/cpu_topo.c index 48837b1db..0416d69db 100644 --- a/src/cpu_topo.c +++ b/src/cpu_topo.c @@ -219,9 +219,12 @@ void cpu_dump_topology(const struct ha_cpu_topo *topo) int cpu, lvl; int grp, thr; - for (cpu = 0; cpu <= cpu_topo_lastcpu; cpu++) - if (ha_cpu_topo[cpu].th_cnt > 1) + for (cpu = 0; cpu <= cpu_topo_lastcpu; cpu++) { + if (ha_cpu_topo[cpu].th_cnt > 1) { has_smt = 1; + break; + } + } for (cpu = 0; cpu <= cpu_topo_lastcpu; cpu++) { if (ha_cpu_topo[cpu].st & HA_CPU_F_OFFLINE)