I have 8 logical CPUs in my linux box. (As seen from /proc/cpuinfo
). When I look in
/sys/kernel/debug/tracing/per_cpu
it shows 32 CPUs.
Why the difference? If it matters, I have hyperthreading disabled in the BIOS.
I have 8 logical CPUs in my linux box. (As seen from /proc/cpuinfo
). When I look in
/sys/kernel/debug/tracing/per_cpu
it shows 32 CPUs.
Why the difference? If it matters, I have hyperthreading disabled in the BIOS.
There's a separate listing for each core. I'm guessing your system has 8 logical CPU's with 4 cores each.
Physical cores are just that, physical cores within the CPU. Logical cores are the abilities of a single core to do 2 or more things simultaneously. This grew out of the early Pentium 4 CPUs ability to do what was termed Hyper Threading (HTT).
It was a bit of a game that was being played where sub components of the core weren't being used for certain types of instructions while, another long running instruction might have been being executed. So the CPU could in effect work on 2 things simultaneously.
Newer cores are more full-fledged CPUs so they're working on multiple things simultaneously, but they aren't true CPUs as the physical cores are. You can read more about the limitations of the hyperthreading functionality vs. the physical capabilities of the core here on tomshardware in this article titled: Intel Core i5 And Core i7: Intel’s Mainstream Magnum Opus.
You can see the breakdown of your box using the
lscpu
command:In the above my Intel i5 laptop has 4 "CPUs" in total
of which there are 2 physical cores
of which each can run up to 2 threads
at the same time. These threads are the core's logical capabilities.
lstopo
You can use the tool
lstopo
to get an actual diagram of your system's topography, this is sometimes helpful in understanding what's significant with a CPU's architecture.If you want a further breakdown of the
lstopo
output take a look at my answer in this U&L Q&A titled: Interpret the output of lstopo.References