Howto display the number of processors in Linux
If you’ve just bought a new desktop,laptop or server and the box says the box is powered by 2 processors, you can actually verify that. |
|
|
Comments (11)
Not with you. If I type top followed by 1 on my system I get a list for cpu0, cpu1, cpu2 and cpu3 each treated equally and reporting percentage utilization. I have a dual processor Xeon chip so have only two real cpus. No where is that fact reported on top that I can see.....
>> Hytherthreading doubles the number of physical processors....
would read better and more accurately as
Hytherthreading doubles the number of apparent processors....
In a true SMP system, say with 2 processors, each clock cycle lets your system "think" about 2 processes.There is actual decoding, additional fetching (on CISC), execution, and retirement happening two-at-a-time.
In HT, this isn't the case. Think of it as a single pipeline, but that pipeline carries a tag showing which of two different current contexts the instruction pertains to. That is, an instruction for context A (say, updatedb) can be followed immediately by another instruction for context B (Firefox?). They are both sent through the same core, but thanks to HT, neither one stomps on the other's operations: the results of updatedb's actions don't affect how Firefox executes. The net result is basically instruction-level timeslicing.
In SMP, two processes can get the full bandwidth of their CPU's, and the only clash comes in memory/cache access. In HT, the bottleneck is the pipeline itself: the bandwidth used by virtual CPU #1 is unavailable for virtual CPU #2. If you have a 2GHz CPU with HT, an evenly distributed load between two processes will run each at roughly the same speed as two 1GHz CPU's. However, if one process stalls a lot due to cache misses (and starts running like a 500MHz Pentium II), the other process will benefit from the unused pipeline bandwidth (and run like a 1.5GHz Pentium III). This benefit is mostly missing from an SMP system, where a stalled CPU does nothing to increase the pipeline bandwidth of any other CPU.
And that's my story, and I'm sticking to it.
Post a comment
A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.
Your message:Sign up and post (it is free) or Log in and post
