From owner-freebsd-stable@FreeBSD.ORG Fri Aug 20 06:25:41 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 688061065694; Fri, 20 Aug 2010 06:25:41 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 725EC8FC15; Fri, 20 Aug 2010 06:25:40 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA22544; Fri, 20 Aug 2010 09:25:37 +0300 (EEST) (envelope-from avg@icyb.net.ua) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1OmL2n-0001MI-1u; Fri, 20 Aug 2010 09:25:37 +0300 Message-ID: <4C6E1FDF.8050708@icyb.net.ua> Date: Fri, 20 Aug 2010 09:25:35 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100603) MIME-Version: 1.0 To: pluknet , Jung-uk Kim References: <201007141414.o6EEEUx9014690@lurza.secnetix.de> <201007141755.04690.jkim@FreeBSD.org> <4C3FB73F.7070502@freebsd.org> <201007161147.56242.jkim@FreeBSD.org> <4C6D5E31.9000701@icyb.net.ua> <4C6D697A.5050302@icyb.net.ua> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-stable@freebsd.org Subject: Re: 8.1-PRERELEASE: CPU packages not detected correctly X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2010 06:25:41 -0000 on 19/08/2010 22:15 pluknet said the following: > On 19 August 2010 21:27, Andriy Gapon wrote: >> on 19/08/2010 19:56 pluknet said the following: >>> CPU: Intel(R) Xeon(R) CPU E5520 @ 2.27GHz (2763.12-MHz 686-class CPU) >>> Origin = "GenuineIntel" Id = 0x106a5 Family = 6 Model = 1a Stepping = 5 >>> Features=0x1781fbbf >>> Features2=0x80982201> >>> TSC: P-state invariant >>> real memory = 4194304000 (4000 MB) >>> avail memory = 3932786688 (3750 MB) >>> ACPI APIC Table: >>> FreeBSD/SMP: Multiprocessor System Detected: 3 CPUs >>> FreeBSD/SMP: 0 package(s) x 1 core(s) x 32 HTT threads >>> cpu0 (BSP): APIC ID: 0 >>> cpu1 (AP/HT): APIC ID: 2 >>> cpu2 (AP/HT): APIC ID: 4 >> Thanks! >> BTW, what does Intel's code report? >> Jung-uk's convenience script: >> http://people.freebsd.org/~jkim/cpu_topology-12212009.sh >> > > Software visible enumeration in the system: > Number of logical processors visible to the OS: 3 > Number of logical processors visible to this process: 3 > Number of processor cores visible to this process: 3 > Number of physical packages visible to this process: 1 > > Hierarchical counts by levels of processor topology: > # of cores in package 0 visible to this process: 3 . So, original Intel code detects the topology correctly. Jung-uk, despite what you said in the parallel followup, I think that this demonstrates that there is a flaw in your patch as compared to the logic in the Intel-provided code. FWIW, I was surprised to see a loop in topo_probe_0x4 - I don't see such a loop in Intel's code. Also, (level == 1 && cpu_logical == logical * cores) verification might be a suspect too. It may be OK for real hardware, but emulated hardware may stick to minimal compatibility required. > Affinity masks per SMT thread, per core, per package: > Individual: > P:0, C:0, T:0 --> 1 > > Core-aggregated: > P:0, C:0 --> 1 > Individual: > P:0, C:1, T:0 --> 2 > > Core-aggregated: > P:0, C:1 --> 2 > Individual: > P:0, C:2, T:0 --> 4 > > Core-aggregated: > P:0, C:2 --> 4 > > Pkg-aggregated: > P:0 --> 7 > > > APIC ID listings from affinity masks > OS cpu 0, Affinity mask 01 - apic id 0 > OS cpu 1, Affinity mask 02 - apic id 2 > OS cpu 2, Affinity mask 04 - apic id 4 > > > Package 0 Cache and Thread details > L1D is Level 1 Data cache, size(KBytes)= 32, Cores/cache= 1, Caches/package= 3 > L1I is Level 1 Instruction cache, size(KBytes)= 32, Cores/cache= 1, > Caches/package= 3 > L2 is Level 2 Unified cache, size(KBytes)= 256, Cores/cache= 1, > Caches/package= 3 > L3 is Level 3 Unified cache, size(KBytes)= 8192, Cores/cache= 1, > Caches/package= 3 > +----+----+----+ > Cache | L1D| L1D| L1D| > Size | 32K| 32K| 32K| > OScpu#| 0| 1| 2| > Core | c0| c1| c2| > AffMsk| 1| 2| 4| > +----+----+----+ > > Cache | L1I| L1I| L1I| > Size | 32K| 32K| 32K| > +----+----+----+ > > Cache | L2| L2| L2| > Size |256K|256K|256K| > +----+----+----+ > > Cache | L3| L3| L3| > Size | 8M| 8M| 8M| > +----+----+----+ > > Combined socket AffinityMask= 0x7 > -- Andriy Gapon