From owner-freebsd-amd64@freebsd.org Thu Mar 23 18:22:59 2017 Return-Path: Delivered-To: freebsd-amd64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9193CD1AD77 for ; Thu, 23 Mar 2017 18:22:59 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E95F165A; Thu, 23 Mar 2017 18:22:59 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id v2NIMp1e054314; Thu, 23 Mar 2017 11:22:55 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201703231822.v2NIMp1e054314@gw.catspoiler.org> Date: Thu, 23 Mar 2017 11:15:44 -0700 (PDT) From: Don Lewis Subject: Re: FreeBSD on Ryzen To: avg@FreeBSD.org cc: freebsd-amd64@FreeBSD.org MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Mar 2017 18:22:59 -0000 resending to the list ... On 23 Mar, Andriy Gapon wrote: > On 03/23/2017 06:05, Don Lewis wrote: >> Package ID shift: 4 >> L3 cache ID shift: 3 >> L2 cache ID shift: 1 >> L1 cache ID shift: 1 >> Core ID shift: 0 >> INTR: Adding local APIC 1 as a target >> INTR: Adding local APIC 2 as a target >> INTR: Adding local APIC 3 as a target >> INTR: Adding local APIC 4 as a target >> INTR: Adding local APIC 5 as a target >> INTR: Adding local APIC 6 as a target >> INTR: Adding local APIC 7 as a target >> INTR: Adding local APIC 8 as a target >> INTR: Adding local APIC 9 as a target >> INTR: Adding local APIC 10 as a target >> INTR: Adding local APIC 11 as a target >> INTR: Adding local APIC 12 as a target >> INTR: Adding local APIC 13 as a target >> INTR: Adding local APIC 14 as a target >> INTR: Adding local APIC 15 as a target >> FreeBSD/SMP: Multiprocessor System Detected: 16 CPUs >> FreeBSD/SMP: 1 package(s) x 16 core(s) > > Don, > > thank you! > Could you please test this patch https://paste.debian.net/923675/ and > see if it allows to detect SMT threads? It took some doing since we don't have the AMDID2_NODE_ID code, but with the patch applied, I do see SMT threads. FreeBSD/SMP: Multiprocessor System Detected: 16 CPUs FreeBSD/SMP: 1 package(s) x 8 core(s) x 2 hardware threads Package HW ID = 0 Core HW ID = 0 CPU0 (BSP): APIC ID: 0 CPU1 (AP/HT): APIC ID: 1 Core HW ID = 1 CPU2 (AP): APIC ID: 2 CPU3 (AP/HT): APIC ID: 3 Core HW ID = 2 CPU4 (AP): APIC ID: 4 CPU5 (AP/HT): APIC ID: 5 Core HW ID = 3 CPU6 (AP): APIC ID: 6 CPU7 (AP/HT): APIC ID: 7 Core HW ID = 4 CPU8 (AP): APIC ID: 8 CPU9 (AP/HT): APIC ID: 9 Core HW ID = 5 CPU10 (AP): APIC ID: 10 CPU11 (AP/HT): APIC ID: 11 Core HW ID = 6 CPU12 (AP): APIC ID: 12 CPU13 (AP/HT): APIC ID: 13 Core HW ID = 7 CPU14 (AP): APIC ID: 14 CPU15 (AP/HT): APIC ID: 15 % sysctl kern.sched.topology_spec kern.sched.topology_spec: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 0, 1, 2, 3, 4, 5, 6, 7 0, 1 THREAD groupSMT group 2, 3 THREAD groupSMT group 4, 5 THREAD groupSMT group 6, 7 THREAD groupSMT group 8, 9, 10, 11, 12, 13, 14, 15 8, 9 THREAD groupSMT group 10, 11 THREAD groupSMT group 12, 13 THREAD groupSMT group 14, 15 THREAD groupSMT group BTW, with SMT disabled in the BIOS I see a 5% speed improvement in "make -j8 buildworld" as compared to SMT enabled with the stock kernel.