From owner-freebsd-current@freebsd.org Thu Apr 7 09:34:33 2016 Return-Path: Delivered-To: freebsd-current@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 596E2B07E01 for ; Thu, 7 Apr 2016 09:34:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 9042B1AAB for ; Thu, 7 Apr 2016 09:34:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA02719 for ; Thu, 07 Apr 2016 12:34:23 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ao6KV-000BT6-QO for freebsd-current@FreeBSD.org; Thu, 07 Apr 2016 12:34:23 +0300 Subject: Opteron 6100-series "Magny-Cours" [Was: [HEADSUP] new x86 smp topology detection code] To: FreeBSD Current References: <201604041609.u34G9TCd022548@repo.freebsd.org> <570296F3.8090307@FreeBSD.org> From: Andriy Gapon Message-ID: <5706297C.3050009@FreeBSD.org> Date: Thu, 7 Apr 2016 12:33:48 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <570296F3.8090307@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Apr 2016 09:34:33 -0000 If anyone uses FreeBSD head on a system with "Magny-Cours" CPU(s), could you please test the following patch? http://dpaste.com/0XRSXZB.txt I am interested in kern.sched.topology_spec sysctl before and after the patch. Also, lines containing "ID shift" from a dmesg of a verbose boot (before and after). Thank you! On 04/04/2016 19:31, Andriy Gapon wrote: > > > I've just committed new code for detecting SMP (processor and cache) topology on > x86 systems. Please be aware. > > If you get any panics or crashes that look like they might be caused by this > change please send a copy of a report to me. > > Another thing to watch is kern.sched.topology_spec. > Please check if the reported topology reasonably matches what you expect on your > system. > You can install hwloc package (devel/hwloc) and then run lstopo -p --no-io to > double-check the topology (--output-format ascii would produce a nice ASCII-art > diagram). > > I hope that you see only improvements :-) > > -------- Forwarded Message -------- > Subject: svn commit: r297558 - in head/sys: kern sys x86/x86 > Date: Mon, 4 Apr 2016 16:09:29 +0000 (UTC) > From: Andriy Gapon > To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org > > Author: avg > Date: Mon Apr 4 16:09:29 2016 > New Revision: 297558 > URL: https://svnweb.freebsd.org/changeset/base/297558 > > Log: > new x86 smp topology detection code > > Previously, the code determined a topology of processing units > (hardware threads, cores, packages) and then deduced a cache topology > using certain assumptions. The new code builds a topology that > includes both processing units and caches using the information > provided by the hardware. > > At the moment, the discovered full topology is used only to creeate > a scheduling topology for SCHED_ULE. > There is no KPI for other kernel uses. > > Summary: > - based on APIC ID derivation rules for Intel and AMD CPUs > - can handle non-uniform topologies > - requires homogeneous APIC ID assignment (same bit widths for ID > components) > - topology for dual-node AMD CPUs may not be optimal > - topology for latest AMD CPU models may not be optimal as the code is > several years old > - supports only thread/package/core/cache nodes > > Todo: > - AMD dual-node processors > - latest AMD processors > - NUMA nodes > - checking for homogeneity of the APIC ID assignment across packages > - more flexible cache placement within topology > - expose topology to userland, e.g., via sysctl nodes > > Long term todo: > - KPI for CPU sharing and affinity with respect to various resources > (e.g., two logical processors may share the same FPU, etc) > > Reviewed by: mav > Tested by: mav > MFC after: 1 month > Differential Revision: https://reviews.freebsd.org/D2728 > > Modified: > head/sys/kern/subr_smp.c > head/sys/sys/smp.h > head/sys/x86/x86/mp_x86.c -- Andriy Gapon