In a machine installed yesterday, 8.1-PRERELEASE doesn't seem to detect the number of CPU packages vs. cores per package correctly: | FreeBSD 8.1-PRERELEASE-20100713 #0: Tue Jul 13 19:51:18 UTC 2010 | [...] | CPU: Intel(R) Xeon(R) CPU L5408 @ 2.13GHz (2133.42-MHz K8-class CPU) | Origin = "GenuineIntel" Id = 0x1067a Family = 6 Model = 17 Stepping = 10 | Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE> | Features2=0x40ce3bd<SSE3,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,DCA,SSE4.1,XSAVE> | AMD Features=0x20000800<SYSCALL,LM> | AMD Features2=0x1<LAHF> | TSC: P-state invariant | real memory = 34359738368 (32768 MB) | avail memory = 33151377408 (31615 MB) | ACPI APIC Table: <IBM SERBLADE> | FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs | FreeBSD/SMP: 1 package(s) x 8 core(s) | cpu0 (BSP): APIC ID: 0 | cpu1 (AP): APIC ID: 1 | cpu2 (AP): APIC ID: 2 | cpu3 (AP): APIC ID: 3 | cpu4 (AP): APIC ID: 4 | cpu5 (AP): APIC ID: 5 | cpu6 (AP): APIC ID: 6 | cpu7 (AP): APIC ID: 7 | ioapic1 <Version 2.0> irqs 24-47 on motherboard | ioapic0 <Version 2.0> irqs 0-23 on motherboard I'm pretty sure that this is a 2 x 4 machine (2 CPU packages with 4 cores per package), not 1 x 8. That's what the BIOS displays during POST. I'm not sure if this is just a "cosmetic" issue, or if this is a critical thing ... I could imagine that performance might be sub-optimal if the CPU topology isn't detected correctly, but I'm not sure if FreeBSD can take advantage of the topology. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Gesch?ftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht M?n- chen, HRB 125758, Gesch?ftsf?hrer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "A misleading benchmark test can accomplish in minutes what years of good engineering can never do." -- Dilbert (2009-03-02)
On 14 July 2010 18:14, Oliver Fromme <olli@lurza.secnetix.de> wrote:> In a machine installed yesterday, 8.1-PRERELEASE doesn't > seem to detect the number of CPU packages vs. cores per > package correctly: > > ?| FreeBSD 8.1-PRERELEASE-20100713 #0: Tue Jul 13 19:51:18 UTC 2010 > ?| [...] > ?| CPU: Intel(R) Xeon(R) CPU ? ? ? ? ? L5408 ?@ 2.13GHz (2133.42-MHz K8-class CPU) > ?| ? Origin = "GenuineIntel" ?Id = 0x1067a ?Family = 6 ?Model = 17 ?Stepping = 10 > ?| ? Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE> > ?| ? Features2=0x40ce3bd<SSE3,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,DCA,SSE4.1,XSAVE> > ?| ? AMD Features=0x20000800<SYSCALL,LM> > ?| ? AMD Features2=0x1<LAHF> > ?| ? TSC: P-state invariant > ?| real memory ?= 34359738368 (32768 MB) > ?| avail memory = 33151377408 (31615 MB) > ?| ACPI APIC Table: <IBM ? ?SERBLADE> > ?| FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs > ?| FreeBSD/SMP: 1 package(s) x 8 core(s) > ?| ?cpu0 (BSP): APIC ID: ?0 > ?| ?cpu1 (AP): APIC ID: ?1 > ?| ?cpu2 (AP): APIC ID: ?2 > ?| ?cpu3 (AP): APIC ID: ?3 > ?| ?cpu4 (AP): APIC ID: ?4 > ?| ?cpu5 (AP): APIC ID: ?5 > ?| ?cpu6 (AP): APIC ID: ?6 > ?| ?cpu7 (AP): APIC ID: ?7 > ?| ioapic1 <Version 2.0> irqs 24-47 on motherboard > ?| ioapic0 <Version 2.0> irqs 0-23 on motherboard > > I'm pretty sure that this is a 2 x 4 machine (2 CPU packages > with 4 cores per package), not 1 x 8. ?That's what the BIOS > displays during POST. >Hi, can you show kern.sched.topology_spec ? It would clarify things a bit. -- wbr, pluknet
on 14/07/2010 17:14 Oliver Fromme said the following:> In a machine installed yesterday, 8.1-PRERELEASE doesn't > seem to detect the number of CPU packages vs. cores per > package correctly: > > | FreeBSD 8.1-PRERELEASE-20100713 #0: Tue Jul 13 19:51:18 UTC 2010 > | [...] > | CPU: Intel(R) Xeon(R) CPU L5408 @ 2.13GHz (2133.42-MHz K8-class CPU) > | Origin = "GenuineIntel" Id = 0x1067a Family = 6 Model = 17 Stepping = 10 > | Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE> > | Features2=0x40ce3bd<SSE3,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,DCA,SSE4.1,XSAVE> > | AMD Features=0x20000800<SYSCALL,LM> > | AMD Features2=0x1<LAHF> > | TSC: P-state invariant > | real memory = 34359738368 (32768 MB) > | avail memory = 33151377408 (31615 MB) > | ACPI APIC Table: <IBM SERBLADE> > | FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs > | FreeBSD/SMP: 1 package(s) x 8 core(s) > | cpu0 (BSP): APIC ID: 0 > | cpu1 (AP): APIC ID: 1 > | cpu2 (AP): APIC ID: 2 > | cpu3 (AP): APIC ID: 3 > | cpu4 (AP): APIC ID: 4 > | cpu5 (AP): APIC ID: 5 > | cpu6 (AP): APIC ID: 6 > | cpu7 (AP): APIC ID: 7 > | ioapic1 <Version 2.0> irqs 24-47 on motherboard > | ioapic0 <Version 2.0> irqs 0-23 on motherboard > > I'm pretty sure that this is a 2 x 4 machine (2 CPU packages > with 4 cores per package), not 1 x 8. That's what the BIOS > displays during POST. > > I'm not sure if this is just a "cosmetic" issue, or if this > is a critical thing ... I could imagine that performance > might be sub-optimal if the CPU topology isn't detected > correctly, but I'm not sure if FreeBSD can take advantage > of the topology.Could you please try to do the following? 1. Fetch topo-12212009.tar from the top of this page: http://software.intel.com/en-us/articles/intel-64-architecture-processor-topology-enumeration/ 2. Untar it and apply this patch to the code: http://people.freebsd.org/~avg/cpu-topology.diff 3. Compile it by running sh mk_64.sh (supposing you have amd64 system installed) 4. Run cpu_topology64.out and report back its output. Thanks! -- Andriy Gapon
On 14 July 2010 18:14, Oliver Fromme <olli@lurza.secnetix.de> wrote:> In a machine installed yesterday, 8.1-PRERELEASE doesn't > seem to detect the number of CPU packages vs. cores per > package correctly: > > ?| FreeBSD 8.1-PRERELEASE-20100713 #0: Tue Jul 13 19:51:18 UTC 2010 > ?| [...] > ?| CPU: Intel(R) Xeon(R) CPU ? ? ? ? ? L5408 ?@ 2.13GHz (2133.42-MHz K8-class CPU) > ?| ? Origin = "GenuineIntel" ?Id = 0x1067a ?Family = 6 ?Model = 17 ?Stepping = 10 > ?| ? Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE> > ?| ? Features2=0x40ce3bd<SSE3,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,DCA,SSE4.1,XSAVE> > ?| ? AMD Features=0x20000800<SYSCALL,LM> > ?| ? AMD Features2=0x1<LAHF> > ?| ? TSC: P-state invariant > ?| real memory ?= 34359738368 (32768 MB) > ?| avail memory = 33151377408 (31615 MB) > ?| ACPI APIC Table: <IBM ? ?SERBLADE> > ?| FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs > ?| FreeBSD/SMP: 1 package(s) x 8 core(s)Just for the reference, I collected CPU detection from various branches. 6.4 Cores per package: 4 FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs 7.3 Cores per package: 4 FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs 8.1-rc FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs FreeBSD/SMP: 1 package(s) x 8 core(s) Indeed, looks like a regression. -- wbr, pluknet
on 10/08/2010 19:55 pluknet said the following:> On 16 July 2010 19:47, Jung-uk Kim <jkim@freebsd.org> wrote: >> The patch should apply fine on both sys/amd64/amd64/mp_machdep.c and >> sys/i386/i386/mp_machdep.c. >> >> http://people.freebsd.org/~jkim/mp_machdep2.diff >> > > > Hi. > > Just checked on Xen HVM with 3 cores. > 1) 8.1 unmodified: > FreeBSD/SMP: Multiprocessor System Detected: 3 CPUs > FreeBSD/SMP: 1 package(s) x 3 core(s) > > 2) 8.1 + patch > FreeBSD/SMP: Multiprocessor System Detected: 3 CPUs > FreeBSD/SMP: 0 package(s) x 1 core(s) x 32 HTT threads > WARNING: Non-uniform processors. > WARNING: Using suboptimal topology.Can you debug, e.g. with printfs, what exactly goes wrong? I wonder if in this case code follows some unusual/unexpected path. BTW, could you please also provide CPU name/model/features as detected by the kernel? Thanks! -- Andriy Gapon
on 29/08/2010 12:25 Andriy Gapon said the following:> The below patch is against sources in FreeBSD tree, it should be applied > either to sys/amd64/amd64/mp_machdep.c or sys/i386/i386/mp_machdep.c depending > on the desired architecture: > http://people.freebsd.org/~avg/intel-cpu-topo.diffI see that I am not getting as many testers as I expected, so I am going to commit the patch. You still have a short while to either objectively object to the patch or to voluntary test it :-) -- Andriy Gapon