summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2018-10-20 20:40:55 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2018-10-20 20:40:55 +0000
commitdede3eb1ada5c81e90e7340d5d9570c6ce22ed38 (patch)
treee6e19be0e0bf2217d282cd89ef959cc36785aeb0 /sys/arch
parentc96400fe961862b82a4ff9f9bab3c9b3e315619a (diff)
Take the "package" into account when calculating the "smt" ID on modern
AMD CPUs. Avoids knocking out too many processor threads on for example the AMD Ryzen Threadtipper 2990WX which apparently consists of 4 separate dies with 8 cores each. Note that the "package" ID really is a "die" ID here. ok sthen@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/amd64/amd64/identcpu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/identcpu.c b/sys/arch/amd64/amd64/identcpu.c
index a212651fcf5..7641ff7fe97 100644
--- a/sys/arch/amd64/amd64/identcpu.c
+++ b/sys/arch/amd64/amd64/identcpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: identcpu.c,v 1.109 2018/10/04 05:00:40 guenther Exp $ */
+/* $OpenBSD: identcpu.c,v 1.110 2018/10/20 20:40:54 kettenis Exp $ */
/* $NetBSD: identcpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
/*
@@ -835,7 +835,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 {