0 Replies Latest reply on May 5, 2011 1:16 PM by gcote

    __cpuid returns incorrect number of logical processors on Xeon X5660

    gcote

      Hello,

       

      I have a HP Z800 with a dual Xeon X5660. 2 x 6 cores x Hyperthreading = 24 logical processors.

       

      In Windows 7 x64, calling GetSystemInfo returns 24 logical processors. Calling GetLogicalProcessorInformation also returns 24. (2 processor packages, 24 logical processors, 12 processor cores).

       

      But calling __cpuid returns 32. I also get 32 even if I disabled hyperthreading in the BIOS.

       

      CPU-Z reports the right information. In the task manager, I see 24 cpus.

       

      I am trying to determine the affinity of each core so that I only run 1 thread per core (no collision between 2 logical processors running on the same core).

       

      I have another machine with a dual Xeon E5520 (2 x 4 cores x Hyperthreading = 16 logical processors).

       

      On the Xeon E5520, setting the affinity to 1, 2, 4, 8 will make the thread run on the first 4 cores while setting the affinity 16, 32, 64 and 128 will make the thread run on the next 4 cores.

       

      On the Xeon X5660, setting the affinity from 1 to 32 will make the thread run on the 6 cores while setting the affinity to 64 to 2048 will make the thread run on different logical processors but on the same cores. Performance are much lower in that case.

       

      I compiled a small program that I found on microsoft web site that shows an example of __cpuid and __cpuidex.

       

      I made sure that I have the latest version of the BIOS and that all the chipset drivers are up to date according to the Intel Update Tool.

       

      Any suggestions are welcomed and appreciated.

       

      Here's the output that I got from the tool that I compiled:

       


      For InfoType 0
      CPUInfo[0] = 0xb
      CPUInfo[1] = 0x756e6547
      CPUInfo[2] = 0x6c65746e
      CPUInfo[3] = 0x49656e69

       

      For InfoType 1
      CPUInfo[0] = 0x206c1
      CPUInfo[1] = 0x200800
      CPUInfo[2] = 0x29ee3ff
      CPUInfo[3] = 0xbfebfbff

       

      For InfoType 2
      CPUInfo[0] = 0x55035a01
      CPUInfo[1] = 0xf0b2ff
      CPUInfo[2] = 0x0
      CPUInfo[3] = 0xca0000

       

      For InfoType 3
      CPUInfo[0] = 0x0
      CPUInfo[1] = 0x0
      CPUInfo[2] = 0x0
      CPUInfo[3] = 0x0

       

      For InfoType 4
      CPUInfo[0] = 0x3c004121
      CPUInfo[1] = 0x1c0003f
      CPUInfo[2] = 0x3f
      CPUInfo[3] = 0x0

       

      For InfoType 5
      CPUInfo[0] = 0x40
      CPUInfo[1] = 0x40
      CPUInfo[2] = 0x3
      CPUInfo[3] = 0x1120

       

      For InfoType 6
      CPUInfo[0] = 0x7
      CPUInfo[1] = 0x2
      CPUInfo[2] = 0x9
      CPUInfo[3] = 0x0

       

      For InfoType 7
      CPUInfo[0] = 0x0
      CPUInfo[1] = 0x0
      CPUInfo[2] = 0x0
      CPUInfo[3] = 0x0

       

      For InfoType 8
      CPUInfo[0] = 0x0
      CPUInfo[1] = 0x0
      CPUInfo[2] = 0x0
      CPUInfo[3] = 0x0

       

      For InfoType 9
      CPUInfo[0] = 0x0
      CPUInfo[1] = 0x0
      CPUInfo[2] = 0x0
      CPUInfo[3] = 0x0

       

      For InfoType 10
      CPUInfo[0] = 0x7300403
      CPUInfo[1] = 0x4
      CPUInfo[2] = 0x0
      CPUInfo[3] = 0x603

       

      For InfoType 11
      CPUInfo[0] = 0x1
      CPUInfo[1] = 0x2
      CPUInfo[2] = 0x100
      CPUInfo[3] = 0x0

       

      For InfoType 80000000
      CPUInfo[0] = 0x80000008
      CPUInfo[1] = 0x0
      CPUInfo[2] = 0x0
      CPUInfo[3] = 0x0

       

      For InfoType 80000001
      CPUInfo[0] = 0x0
      CPUInfo[1] = 0x0
      CPUInfo[2] = 0x1
      CPUInfo[3] = 0x2c100000

       

      For InfoType 80000002
      CPUInfo[0] = 0x65746e49
      CPUInfo[1] = 0x2952286c
      CPUInfo[2] = 0x6f655820
      CPUInfo[3] = 0x2952286e

       

      For InfoType 80000003
      CPUInfo[0] = 0x55504320
      CPUInfo[1] = 0x20202020
      CPUInfo[2] = 0x20202020
      CPUInfo[3] = 0x58202020

       

      For InfoType 80000004
      CPUInfo[0] = 0x30363635
      CPUInfo[1] = 0x20402020
      CPUInfo[2] = 0x30382e32
      CPUInfo[3] = 0x7a4847

       

      For InfoType 80000005
      CPUInfo[0] = 0x0
      CPUInfo[1] = 0x0
      CPUInfo[2] = 0x0
      CPUInfo[3] = 0x0

       

      For InfoType 80000006
      CPUInfo[0] = 0x0
      CPUInfo[1] = 0x0
      CPUInfo[2] = 0x1006040
      CPUInfo[3] = 0x0

       

      For InfoType 80000007
      CPUInfo[0] = 0x0
      CPUInfo[1] = 0x0
      CPUInfo[2] = 0x0
      CPUInfo[3] = 0x100

       

      For InfoType 80000008
      CPUInfo[0] = 0x3028
      CPUInfo[1] = 0x0
      CPUInfo[2] = 0x0
      CPUInfo[3] = 0x0

       


      CPU String: GenuineIntel
      Stepping ID = 1
      Model = 12
      Family = 6
      Extended model = 2
      CLFLUSH cache line size = 64
      Logical Processor Count = 32

       

      The following features are supported:
          SSE3
          MONITOR/MWAIT
          CPL Qualified Debug Store
          Virtual Machine Extensions
          Enhanced Intel SpeedStep Technology
          Thermal Monitor 2
          Supplemental Streaming SIMD Extensions 3
          L1 Context ID
          CMPXCHG16B Instruction
          xTPR Update Control
          Perf\Debug Capability MSR
          SSE4.1 Extensions
          SSE4.2 Extensions
          PPOPCNT Instruction
          x87 FPU On Chip
          Virtual-8086 Mode Enhancement
          Debugging Extensions
          Page Size Extensions
          Time Stamp Counter
          RDMSR and WRMSR Support
          Physical Address Extensions
          Machine Check Exception
          CMPXCHG8B Instruction
          APIC On Chip
          SYSENTER and SYSEXIT
          Memory Type Range Registers
          PTE Global Bit
          Machine Check Architecture
          Conditional Move/Compare Instruction
          Page Attribute Table
          36-bit Page Size Extension
          CFLUSH Extension
          Debug Store
          Thermal Monitor and Clock Ctrl
          MMX Technology
          FXSAVE/FXRSTOR
          SSE Extensions
          SSE2 Extensions
          Self Snoop
          Multithreading Technology
          Thermal Monitor
          Pending Break Enable
          LAHF/SAHF in 64-bit mode
          RDTSCP instruction
          64 bit Technology

       

      CPU Brand String: Intel(R) Xeon(R) CPU           X5660  @ 2.80GHz
      Cache Line Size = 64
      L2 Associativity = 6
      Cache Size = 256K

       


      Number of Cores = 16

       

      ECX Index 0
         Type: Data Cache
         Level = 2
         Self Initializing
         Is Not Fully Associatve
         Max Threads = 2
         System Line Size = 64
         Physical Line Partions = 1
         Ways of Associativity = 8
         Number of Sets = 64

       

      ECX Index 1
         Type: Instruction Cache
         Level = 2
         Self Initializing
         Is Not Fully Associatve
         Max Threads = 2
         System Line Size = 64
         Physical Line Partions = 1
         Ways of Associativity = 4
         Number of Sets = 128

       

      ECX Index 2
         Type: Unified Cache
         Level = 3
         Self Initializing
         Is Not Fully Associatve
         Max Threads = 2
         System Line Size = 64
         Physical Line Partions = 1
         Ways of Associativity = 8
         Number of Sets = 512

       

      ECX Index 3
         Type: Unified Cache
         Level = 4
         Self Initializing
         Is Not Fully Associatve
         Max Threads = 32
         System Line Size = 64
         Physical Line Partions = 1
         Ways of Associativity = 16
         Number of Sets = 12288