Our website would like to use cookies to store information on your computer. You may delete and block all cookies from this site, but parts of the site will not work as a result. Find out more about how we use cookies.

Login or Register

Powered by
Powered by Novacaster
 
Bone idle CPUs
by Hugo van der Sanden at 11:53 02/12/09 (Blogs::Hugo)

I don't understand this at all.

This result is consistent:

crypt# /usr/bin/time taskset 1 perl -e '$s+=$_ for 1 .. 5e6'
1.12user 0.00system 0:01.13elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+427minor)pagefaults 0swaps
crypt# /usr/bin/time taskset 2 perl -e '$s+=$_ for 1 .. 5e6'
3.07user 0.00system 0:03.08elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+426minor)pagefaults 0swaps
crypt# 

That is to say: when forced to run on CPU 0, this (makework example) code requires the use of the processor for 1.12 seconds. The same code forced to run on CPU 1 requires the use of the processor for 3.07 seconds.

It took me a week to work out what was causing the random differences in timing for my purely deterministic code, and now I know I am none the wiser. :(

/proc/cpuinfo shows no significant difference between them:

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 6
model name      : Intel(R) Pentium(R) D CPU 2.80GHz
stepping        : 4
cpu MHz         : 1400.000
cache size      : 2048 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 6
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov
                  pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx
                  lm constant_tsc pni monitor ds_cpl est cid cx16 xtpr lahf_lm
bogomips        : 5589.24
clflush size    : 64

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 15
model           : 6
model name      : Intel(R) Pentium(R) D CPU 2.80GHz
stepping        : 4
cpu MHz         : 1400.000
cache size      : 2048 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 6
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov
                  pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx
                  lm constant_tsc pni monitor ds_cpl est cid cx16 xtpr lahf_lm
bogomips        : 5585.56
clflush size    : 64

So why does CPU 1 have to work 3 times as hard as CPU 0 to execute the same code? Is it just stupider?

Hugo

<< Time for a new mail server? Frustrated >>
View Comments (Threaded Mode) Printer Version
Bone idle CPUs Hugo van der Sanden - 11:53 02/12/09
Re: Bone idle CPUs Bruce Ure - 12:05 02/12/09
That's Very Strange.

Maybe the second processor is further from the power supply so the electricity takes longer to get to and from it.

Oh ok, seriously then.

Faulty processor?

Is there any diagnostic stuff you can run on them?

Or, maybe the memory serving the CPUs isn't shared, and the half serving the slow one is faulty? Could it be a dodgy memory stick?

I know you don't really 'do' hardware but maybe swap them around and run it again.

The only other thing I can think might help is to reset the BIOS to its "optimised defaults" in case a setting's gone squiffy.

Failing that you could always bring it to ComputerFIX (discount for cat owners).

--

Re: Bone idle CPUs Simon - 12:28 02/12/09
That's odd - here are my results:


sb@hathor:~$ /usr/bin/time taskset 1 perl -e '$s+=$_ for 1 .. 5e6'
0.61user 0.00system 0:00.62elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+621minor)pagefaults 0swaps


sb@hathor:~$ /usr/bin/time taskset 2 perl -e '$s+=$_ for 1 .. 5e6'
0.61user 0.00system 0:00.62elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+622minor)pagefaults 0swaps


sb@hathor:~$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Pentium(R) Dual CPU T3200 @ 2.00GHz
stepping : 13
cpu MHz : 1000.000
cache size : 1024 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl pni monitor ds_cpl est tm2 ssse3 cx16 xtpr lahf_lm
bogomips : 3989.99
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:


processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Pentium(R) Dual CPU T3200 @ 2.00GHz
stepping : 13
cpu MHz : 1000.000
cache size : 1024 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl pni monitor ds_cpl est tm2 ssse3 cx16 xtpr lahf_lm
bogomips : 3990.02
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

What machine's this on, and what distro?
--
simon

Re: Bone idle CPUs Bruce Ure - 12:55 02/12/09
'taskset' doesn't exist on osx's "unix" so I can't run the same test but if you've any ideas what else could be used, I'm happy to give it a whirl.

--

Re: Bone idle CPUs Hugo van der Sanden - 13:22 02/12/09
The key phrase is "cpu affinity". Searching for that plus OSX throws up a few threads that suggest there is no way to set it for your system.

Hugo

Re: Bone idle CPUs Hugo van der Sanden - 13:29 02/12/09
Stranger still - I notice that even my cleverer CPU is a lot slower than yours, despite claiming better stats in all respects.

This is the same machine that I had in the UK, running the same (old) Fedora Core distribution.

(Also odd: "cpu family 15, model 6" v. "cpu family 6, model 15" - I wonder whether one of us is reporting that the wrong way round, or whether it's accurate and just a coincidence.)

Hugo

Re: Bone idle CPUs Bruce Ure - 13:38 02/12/09
You could boot one of the 'live' CD distributions of eg. Ubuntu and run the tests again to eliminate, or not, your linux version/installation.

--

Re: Bone idle CPUs Simon - 13:40 02/12/09
Given the thashing your CPUs have had over the years, maybe we shouldn't be surprised :-)

I reckon Bruce might be onto something with the slow RAM in one bank idea. Alternatively, perhaps your slow CPU already has an active process tied to it for some reason?

What happens if you boot single user and run the tests again?
--
simon