> Date: Fri, 5 Oct 2018 00:34:02 -0700
> From: Philip Guenther <[email protected]>
>
> On Thu, 4 Oct 2018, Georgy Yakovlev wrote:
> ...
> > >Description:
> > After boot I noticed that on my TR2 220WX system kernel only uses
> > 8 cores out of 32 with hw.smt=0
> > Not sure if it's correct.
> > According to my understanding if I set hw.smt=0 system should
> > see 32 cores, not 8.
>
> hw.smt=0 disables all CPUs where the 'smt' topology value is nonzero.
> Per the dmesg you included, the smt values on the 64 CPUs range from 0 to
> 7, with eight having an smt value of zero.
>
> Now, perhaps the smt values returned by cpuid are misleading on this CPU:
> it appears that the combination of smt and core is unique _across_
> packages: maybe we should instead enable the CPU with the lowest smt value
> for each package and core.
Nah. Our code to assign the smt value doesn't take the package into
account.
ok?
Index: arch/amd64/amd64/identcpu.c
===================================================================
RCS file: /cvs/src/sys/arch/amd64/amd64/identcpu.c,v
retrieving revision 1.108
diff -u -p -r1.108 identcpu.c
--- arch/amd64/amd64/identcpu.c 24 Aug 2018 06:25:40 -0000 1.108
+++ arch/amd64/amd64/identcpu.c 5 Oct 2018 08:35:06 -0000
@@ -836,7 +836,8 @@ cpu_topology(struct cpu_info *ci)
ci->ci_smt_id = 0;
CPU_INFO_FOREACH(cii, ci_other) {
if (ci != ci_other &&
- ci_other->ci_core_id == ci->ci_core_id)
+ ci_other->ci_core_id == ci->ci_core_id &&
+ ci_other->ci_pkg_id == ci->ci_pkg_id)
ci->ci_smt_id++;
}
} else {