From owner-cvs-src-old@FreeBSD.ORG Fri Oct 1 10:33:25 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86E6F1065695 for ; Fri, 1 Oct 2010 10:33:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 5AC798FC1C for ; Fri, 1 Oct 2010 10:33:25 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id o91AXPQA026817 for ; Fri, 1 Oct 2010 10:33:25 GMT (envelope-from avg@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id o91AXPcg026816 for cvs-src-old@freebsd.org; Fri, 1 Oct 2010 10:33:25 GMT (envelope-from avg@repoman.freebsd.org) Message-Id: <201010011033.o91AXPcg026816@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to avg@repoman.freebsd.org using -f From: Andriy Gapon Date: Fri, 1 Oct 2010 10:32:54 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/amd64/amd64 mp_machdep.c src/sys/i386/i386 mp_machdep.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2010 10:33:25 -0000 avg 2010-10-01 10:32:54 UTC FreeBSD src repository Modified files: sys/amd64/amd64 mp_machdep.c sys/i386/i386 mp_machdep.c Log: SVN rev 213323 on 2010-10-01 10:32:54Z by avg i386 and amd64 mp_machdep: improve topology detection for Intel CPUs This patch is significantly based on previous work by jkim. List of changes: - added comments that describe topology uniformity assumption - added reference to Intel Processor Topology Enumeration article - documented a few global variables that describe topology - retired weirdly set and used logical_cpus variable - changed fallback code for mp_ncpus > 0 case, so that CPUs are treated as being different packages rather than cores in a single package - moved AMD-specific code to topo_probe_amd [jkim] - in topo_probe_0x4() follow Intel-prescribed procedure of deriving SMT and core masks and match APIC IDs against those masks [started by jkim] - in topo_probe_0x4() drop code for double-checking topology parameters by looking at L1 cache properties [jkim] - in topo_probe_0xb() add fallback path to topo_probe_0x4() as prescribed by Intel [jkim] Still to do: - prepare for upcoming AMD CPUs by using new mechanism of uniform topology description [pointed by jkim] - probe cache topology in addition to CPU topology and probably use that for scheduler affinity topology; e.g. Core2 Duo and Athlon II X2 have the same CPU topology, but Athlon cores do not share L2 cache while Core2's do (no L3 cache in both cases) - think of supporting non-uniform topologies if they are ever implemented for platforms in question - think how to better described old HTT vs new HTT distinction, HTT vs SMT can be confusing as SMT is a generic term - more robust code for marking CPUs as "logical" and/or "hyperthreaded", use HTT mask instead of modulo operation - correct support for halting logical and/or hyperthreaded CPUs, let scheduler know that it shouldn't schedule any threads on those CPUs PR: kern/145385 (related) In collaboration with: jkim Tested by: Sergey Kandaurov , Jeremy Chadwick , Chip Camden , Steve Wills , Olivier Smedts , Florian Smeets MFC after: 1 month Revision Changes Path 1.333 +125 -86 src/sys/amd64/amd64/mp_machdep.c 1.319 +125 -86 src/sys/i386/i386/mp_machdep.c