From dede3eb1ada5c81e90e7340d5d9570c6ce22ed38 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sat, 20 Oct 2018 20:40:55 +0000 Subject: 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@ --- sys/arch/amd64/amd64/identcpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/arch') 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 { -- cgit v1.2.3