views:

97

answers:

2

alt text

As you can see from the attached image the CPU graph on my dual core machine is weirdly symmetrical!

Is this some sort of load balancing to prevent one core being used more than the other? What are the reasons behind it (heat distribution maybe)?

Of course my main concern: is my single thread PSNR image algorithm achieving 100%?

CPU is Core 2 Duo E6850 3Ghz running Ubuntu 10.4.

Thanks

Ross

A: 

(Should have used comments for this, but I don't have enough rep!)

I encountered this situation more than once before, and always with an application conflict.

For example, it can happen when compiz is started twice, or when it is partially unintalled. I found it could also happen when reading DVDs with two different players at the same time.

In my experience, it's not normal behaviour: the computer slows down quite a lot,which is annoying when you're trying to fix it!

passcod
"(Should have used comments for this, but I don't have enough rep!)"... voting down is not gonna help me... but ok. But, you're not telling me this is normal behaviour. This one is failing to uninstall JACK: http://yfrog.com/n6screenshotsmp
passcod
+2  A: 

You are achieving a 50% load using both CPUs. Your program is not attached to a fixed CPU so it's switching, depending on the kernel (and other processes running on your system).

If you want to be sure your process is running on one of your cores, you have to set affinity (Example here). This way, you should see a 100% load on one core, the other one being used for other tasks.

Scharron
I guess that's why they call it Symmetric MultiProcessing! I don't think I've seen this behaviour in windows.It would be great to understand how it works from a computer science perspective? I wonder if there's any trade off's such as lag time between core swap-over?
ross
In SMP (Symmetric multiprocessing), symmetric means that all CPUs are equal. Asymmetric means that some CPU are different, and tasks are allocated to CPUs depending on the tasks to achieve.
Scharron
From what I know, Linux is trying to stick a process on a CPU. It avoids clearing some caches, and to reload full processor context (registers, ...).However, if other processes (with more priority for example) really need this CPU (because the other one is already busy), they can be put in pause, then the processor will put them back on the next available CPU.
Scharron