I am running 10 processes that each use 20-70% of a core of an i7-920 with 8 cores on Ubuntu 11.04. CPU scaling is turned off.

When I look at htop, I see that cores 4 and 8 are almost unused, while core 1 and 5 are almost always at 100%. It is making my load average very high.

I have to manually use taskset to force a process on an unused core to make the load average go down.

Is there anything do about this? I do not like having to manually assign processes to individual cores. Perhaps there is a setting, or maybe the newest Linux kernel may help with this?

  • An i7-920 has only four physical cores, BTW; SMT presents 8 logical cores, but pairs of those logical cores run on the same physical core. – dbenhur Apr 4 '12 at 1:18
  • Core 4 and 8 are the same physical core. Why is nothing running on that core? – Bob Apr 4 '12 at 2:27
  • because the scheduler thinks it has better things to run on that core. When you say your load average is high, what values are you actually talking about? – dbenhur Apr 4 '12 at 4:56
  • A number please, @Bob, not a link to how load is calculated. What is the load number on your 8-logical-cpu box? Is it over 8.0? If not, you can completely stop worrying the issue at all. I'm just asking low hanging fruit, as there still seem to be too many people that think load > 1.0 is a problem when it's really load > cpu-count that signals overload (more runnable processors than a resource to run them on). – dbenhur Apr 4 '12 at 16:08

"My computer is doing something smart, and I have to keep forcing it to be dumb. How can I stop it?" Just leave it alone, it's doing the right thing. It's preferring to keep load off cores that share caches, which is the right thing.

| improve this answer | |
  • They don't just share cache, they share execution units and some TLBs. – dbenhur Apr 4 '12 at 1:29
  • I'm not 100% familiar with the internal layout of the i7-920, but in other quad-core CPUs by Intel, each pair of physical cores shares L2 cache and each pair of virtual cores shares execution units. So both types of sharing are going on, but on different scales. (If the question is "why only four cores", it's primarily sharing of execution units. If it's "why only two or six", it's primarily sharing of cache. I think.) – David Schwartz Apr 4 '12 at 2:17
  • I did some research on the i7-920 and other Bloomfield CPUs. It seems the physical cores do not share any L2 cache (each physical core has its own) and all L3 cache is accessible by all cores. So it's a bit different from earlier Intel designs. (The CPU does make this information available to the OS and the scheduler does take it into account.) – David Schwartz Apr 4 '12 at 2:26
  • If this is true, why does my load average go down if I am forcing it to be dumb? – Bob Apr 4 '12 at 2:26
  • The load average goes down because you're forcing the system to be dumb and so fewer processes are ready to run. The faster you can complete the work necessary to make a process ready to run, the more processes will be ready to run and hence the higher the load average will be. The low load average indicates the system is taking a very long time getting processes ready to run. Another factor is that with the system computing slower, less I/O is waiting to be done at a given time (because you're not ready to do it yet), and that drives the load average down. – David Schwartz Apr 4 '12 at 2:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.